From bf0563242f9999393db984de54518b84bb959535 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 20 Jan 2024 10:33:17 -0800 Subject: [PATCH] build: provide some backwards compatibility for option changes 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`. --- CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 178c96113..71227653c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)