mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-24 09:08:44 +02:00
Add MSGPACK_USE_STATIC_BOOST
cmake option
This commit is contained in:
parent
0b8d6a6614
commit
4ed6b45abd
@ -27,6 +27,8 @@ OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF)
|
|||||||
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
|
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
|
||||||
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
|
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
|
||||||
OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" 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)")
|
||||||
|
|
||||||
SET (CMAKE_CXX_STANDARD_REQUIRED ON)
|
SET (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
@ -60,7 +62,14 @@ IF (MSGPACK_32BIT)
|
|||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
SET (Boost_USE_MULTITHREADED ON)
|
SET (Boost_USE_MULTITHREADED ON)
|
||||||
SET (Boost_USE_STATIC_RUNTIME OFF)
|
|
||||||
|
IF (MSGPACK_USE_STATIC_BOOST)
|
||||||
|
MESSAGE (STATUS "Staticly linking with Boost")
|
||||||
|
SET (Boost_USE_STATIC_LIBS TRUE)
|
||||||
|
ELSE ()
|
||||||
|
MESSAGE (STATUS "Dynamically linking with Boost")
|
||||||
|
SET (Boost_USE_STATIC_LIBS FALSE)
|
||||||
|
ENDIF ()
|
||||||
|
|
||||||
IF (MSGPACK_CHAR_SIGN)
|
IF (MSGPACK_CHAR_SIGN)
|
||||||
SET (CMAKE_CXX_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_CXX_FLAGS}")
|
||||||
@ -69,6 +78,7 @@ ENDIF ()
|
|||||||
IF (MSGPACK_DEFAULT_API_VERSION)
|
IF (MSGPACK_DEFAULT_API_VERSION)
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=${MSGPACK_DEFAULT_API_VERSION} ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=${MSGPACK_DEFAULT_API_VERSION} ${CMAKE_CXX_FLAGS}")
|
||||||
ELSE ()
|
ELSE ()
|
||||||
|
SET (MSGPACK_DEFAULT_API_VERSION 3)
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=3 ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=3 ${CMAKE_CXX_FLAGS}")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
@ -153,6 +153,8 @@ Other useful options:
|
|||||||
- `MSGPACK_32BIT` (default `OFF`): 32bit compile
|
- `MSGPACK_32BIT` (default `OFF`): 32bit compile
|
||||||
- `MSGPACK_USE_X3_PARSE` (default `OFF`): use Boost X3 parse
|
- `MSGPACK_USE_X3_PARSE` (default `OFF`): use Boost X3 parse
|
||||||
(note that it requires C++14 or newer)
|
(note that it requires C++14 or newer)
|
||||||
|
- `MSGPACK_CHAR_SIGN` (not set explicitly by default): char sign to use (signed or unsigned)
|
||||||
|
- `MSGPACK_USE_STATIC_BOOST` (default `OFF`): statically link with boost libraries
|
||||||
|
|
||||||
#### GUI on Windows
|
#### GUI on Windows
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
|
IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
|
||||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS context system unit_test_framework)
|
FIND_PACKAGE (Boost REQUIRED COMPONENTS context system)
|
||||||
FIND_PACKAGE (Threads REQUIRED)
|
FIND_PACKAGE (Threads REQUIRED)
|
||||||
|
|
||||||
LIST (APPEND exec_PROGRAMS
|
LIST (APPEND exec_PROGRAMS
|
||||||
@ -43,7 +43,6 @@ IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
|
|||||||
msgpackc-cxx
|
msgpackc-cxx
|
||||||
Boost::context
|
Boost::context
|
||||||
Boost::system
|
Boost::system
|
||||||
Boost::unit_test_framework
|
|
||||||
Threads::Threads
|
Threads::Threads
|
||||||
)
|
)
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
@ -11,6 +11,10 @@ FOREACH (source_file ${check_PROGRAMS})
|
|||||||
${source_file_we}
|
${source_file_we}
|
||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TARGET_COMPILE_DEFINITIONS (${source_file_we} PRIVATE
|
||||||
|
$<IF:$<BOOL:${MSGPACK_USE_STATIC_BOOST}>,,BOOST_TEST_DYN_LINK>)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we}
|
||||||
msgpackc-cxx
|
msgpackc-cxx
|
||||||
Threads::Threads
|
Threads::Threads
|
||||||
@ -18,7 +22,9 @@ FOREACH (source_file ${check_PROGRAMS})
|
|||||||
Boost::system
|
Boost::system
|
||||||
Boost::unit_test_framework
|
Boost::unit_test_framework
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_TEST (${source_file_we} ${source_file_we})
|
ADD_TEST (${source_file_we} ${source_file_we})
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Wno-mismatched-tags -g")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Wno-mismatched-tags -g")
|
||||||
IF ("${MSGPACK_SAN}" STREQUAL "ASAN")
|
IF ("${MSGPACK_SAN}" STREQUAL "ASAN")
|
||||||
|
@ -74,6 +74,9 @@ FOREACH (source_file ${check_PROGRAMS})
|
|||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TARGET_COMPILE_DEFINITIONS (${source_file_we} PRIVATE
|
||||||
|
$<IF:$<BOOL:${MSGPACK_USE_STATIC_BOOST}>,,BOOST_TEST_DYN_LINK>)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we}
|
||||||
msgpackc-cxx
|
msgpackc-cxx
|
||||||
Boost::system
|
Boost::system
|
||||||
@ -81,6 +84,7 @@ FOREACH (source_file ${check_PROGRAMS})
|
|||||||
Threads::Threads
|
Threads::Threads
|
||||||
ZLIB::ZLIB
|
ZLIB::ZLIB
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_TEST (NAME ${source_file_we} COMMAND ${source_file_we})
|
ADD_TEST (NAME ${source_file_we} COMMAND ${source_file_we})
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user