add option in CMake

This commit is contained in:
Uy Ha 2023-07-03 13:50:37 +00:00
parent 327f3d1ad0
commit 818d87c9cb

View File

@ -23,16 +23,17 @@ OPTION (MSGPACK_CXX14 "Using c++14 compiler" OFF)
OPTION (MSGPACK_CXX17 "Using c++17 compiler" OFF)
OPTION (MSGPACK_CXX20 "Using c++20 compiler" OFF)
OPTION (MSGPACK_32BIT "32bit compile" OFF)
OPTION (MSGPACK_USE_BOOST "Use Boost libraried" ON)
OPTION (MSGPACK_USE_X3_PARSE "Use Boost X3 parse" OFF)
OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF)
OPTION (MSGPACK_BUILD_DOCS "Build Doxygen documentation" ON)
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" OFF)
OPTION (MSGPACK_USE_STATIC_BOOST "Statically link with boost libraries" OFF)
OPTION (MSGPACK_CHAR_SIGN "Char sign to use (signed or unsigned)")
OPTION (MSGPACK_32BIT "32bit compile" OFF)
OPTION (MSGPACK_USE_BOOST "Use Boost libraried" ON)
OPTION (MSGPACK_USE_X3_PARSE "Use Boost X3 parse" OFF)
OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF)
OPTION (MSGPACK_BUILD_DOCS "Build Doxygen documentation" ON)
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" OFF)
OPTION (MSGPACK_USE_STATIC_BOOST "Statically link with boost libraries" OFF)
OPTION (MSGPACK_CHAR_SIGN "Char sign to use (signed or unsigned)")
OPTION (MSGPACK_USE_STD_VARIANT_ADAPTOR "Enable the adaptor for std::variant" OFF)
SET (CMAKE_CXX_STANDARD_REQUIRED ON)
@ -92,6 +93,10 @@ ELSE ()
TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_DEFAULT_API_VERSION=3)
ENDIF ()
IF (MSGPACK_USE_STD_VARIANT_ADAPTOR)
TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_USE_STD_VARIANT_ADAPTOR)
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.1)
INCLUDE (CheckCXXSourceCompiles)