Skip to content

Commit

Permalink
build: provide some backwards compatibility for option changes
Browse files Browse the repository at this point in the history
Introduce an author warning for the use of `CMARK_SHARED` and
`CMARK_STATIC` to redirect the author of the dependent package to
`BUILD_SHARED_LIBS`.
  • Loading branch information
compnerd committed Jan 20, 2024
1 parent 5caa6d5 commit bf05632
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,25 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "Do not build in-source.\nPlease remove CMakeCache.txt and the CMakeFiles/ directory.\nThen: mkdir build ; cd build ; cmake .. ; make")
endif()

# Backwards Compatibility
# TODO: remove this once there has been a period to enable people to migrate
set(_CMARK_BUILD_SHARED_LIBS_DEFAULT NO)
if(CMARK_SHARED)
message(AUTHOR_WARNING [=[
'CMARK_SHARED' has been replaced with the standard 'BUILD_SHARED_LIBS' to control the library type.
]=])
set(_CMARK_BUILD_SHARED_LIBS_DEFAULT YES)
endif()
if(CMARK_STATIC)
message(AUTHOR_WARNING [=[
'CMARK_STATIC' has been replaced with the standard 'BUILD_SHARED_LIBS' to control the library type.
]=])
set(_CMARK_BUILD_SHARED_LIBS_DEFAULT NO)
endif()

option(CMARK_LIB_FUZZER "Build libFuzzer fuzzing harness" OFF)
option(BUILD_SHARED_LIBS "Build the CMark library as shared"
${_CMARK_BUILD_SHARED_LIBS_DEFAULT})

if(NOT MSVC)
set(CMAKE_C_STANDARD 99)
Expand Down

0 comments on commit bf05632

Please sign in to comment.