From 65d5853f62b93213f820fb29837a4baa378013a0 Mon Sep 17 00:00:00 2001 From: Roger Zhong Date: Thu, 26 Oct 2023 15:38:20 -0700 Subject: [PATCH] change cmake file --- CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 340e109..a336c11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,15 +73,16 @@ endif(BUILD_TESTS) # Boost dependencies # ######################################### set(Boost_USE_STATIC_LIBS ON) -set(Boost_USE_DEBUG_RUNTIME OFF) +set(Boost_USE_STATIC_RUNTIME ON) +#set(Boost_USE_DEBUG_RUNTIME OFF) #set_property(GLOBAL PROPERTY Boost_USE_MULTITHREADED ON) -set(BOOST_PKG_VERSION "1.81.0" CACHE STRING "") -find_package(Boost ${BOOST_PKG_VERSION} REQUIRED COMPONENTS system log log_setup thread program_options date_time filesystem chrono) +#set(BOOST_PKG_VERSION "1.81.0" CACHE STRING "") +find_package(Boost REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) -foreach(BOOST_LIB ${Boost_LIBRARIES}) - string(REPLACE ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_SUFFIX} BOOST_STATIC_LIB ${BOOST_LIB}) - list(APPEND Boost_STATIC_LIBRARIES ${BOOST_STATIC_LIB}) -endforeach() +#foreach(BOOST_LIB ${Boost_LIBRARIES}) +# string(REPLACE ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_SUFFIX} BOOST_STATIC_LIB ${BOOST_LIB}) +# list(APPEND Boost_STATIC_LIBRARIES ${BOOST_STATIC_LIB}) +#endforeach() ######################################### # Target : Build aws-tunnel-local-proxy # @@ -112,7 +113,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} OpenSSL::SSL) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} OpenSSL::Crypto) -target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} ${Boost_STATIC_LIBRARIES}) +target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} ${Boost_LIBRARIES}) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} ${Protobuf_LITE_STATIC_LIBRARY}) set_property(TARGET ${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS ${CUSTOM_COMPILER_FLAGS}) @@ -120,7 +121,7 @@ if(BUILD_TESTS) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} OpenSSL::SSL) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} OpenSSL::Crypto) - target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} ${Boost_STATIC_LIBRARIES}) + target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} ${Boost_LIBRARIES}) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} ${Protobuf_LITE_STATIC_LIBRARY}) set_property(TARGET ${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS ${TEST_COMPILER_FLAGS}) endif(BUILD_TESTS)