Disable boost static linking, workaround for BOOST_TEST_DYN_LINK

This commit is contained in:
Peter Conrad 2015-04-14 10:37:50 +02:00
parent 18a484e4bf
commit 381a1258d1

View file

@ -44,7 +44,6 @@ IF( WIN32 )
SET(BOOST_ROOT $ENV{BOOST_ROOT})
# set(Boost_USE_DEBUG_PYTHON ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_LIBS ON)
set(BOOST_ALL_DYN_LINK OFF) # force dynamic linking for all libraries
FIND_PACKAGE(Boost 1.53 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
@ -62,7 +61,6 @@ IF( WIN32 )
ELSE(WIN32)
MESSAGE(STATUS "Configuring fc to build on Unix/Apple")
SET(Boost_USE_STATIC_LIBS ON)
LIST(APPEND BOOST_COMPONENTS coroutine)
FIND_PACKAGE(Boost 1.53 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
@ -236,6 +234,14 @@ target_include_directories(fc
#target_link_libraries( fc PUBLIC easylzma_static scrypt udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library})
target_link_libraries( fc PUBLIC easylzma_static udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library})
IF(NOT BOOST_unit_test_framework_LIBRARY MATCHES "\\.a$")
IF(WIN32)
add_definitions(/DBOOST_TEST_DYN_LINK)
ELSE(WIN32)
add_definitions(-DBOOST_TEST_DYN_LINK)
ENDIF(WIN32)
ENDIF()
add_executable( api tests/api.cpp )
target_link_libraries( api fc )