diff --git a/CMakeLists.txt b/CMakeLists.txt index d44df4e2..8dc6d610 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)