summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTransporter <ogre.transporter@gmail.com>2020-04-30 20:56:55 +0200
committerTransporter <ogre.transporter@gmail.com>2020-04-30 20:56:55 +0200
commit18421d59708479e3d54eba71518f761ee470256d (patch)
tree237f9d7c10869d12c0fa5434e9a51d3a6ece7e36
parent68a49a080cb7b9484b0c8330cf15a99084e5f63f (diff)
Fix to prevent Boost from linking dynamic and static libraries simultaneously when autolink is enabled.
-rw-r--r--CMakeLists.txt3
-rw-r--r--test/CMakeLists.txt2
2 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3a7e94..871e9b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,6 +60,9 @@ else()
endif()
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR_RELEASE})
+if(NOT Boost_USE_STATIC_LIBS)
+ add_definitions(-DBOOST_ALL_DYN_LINK)
+endif()
set(LIB_LIST
${CMAKE_THREAD_LIBS_INIT}
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 3f8249b..0cce236 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -7,5 +7,5 @@ set(TEST_SRC_LIST
include_directories("${PROJECT_SOURCE_DIR}/test")
add_executable(${PROJECT_NAME}_test ${TEST_SRC_LIST})
-target_link_libraries(${PROJECT_NAME}_test TgBot)
+target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME})
add_test(${PROJECT_NAME}_test ${PROJECT_NAME}_test)