提交 628f5999 编写于 作者: A Alessandro Siniscalchi

[cmake] boost set in one place and removed unreachable code

上级 c78d0d04
...@@ -45,20 +45,6 @@ endif(USE_PCH) ...@@ -45,20 +45,6 @@ endif(USE_PCH)
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules" ) list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules" )
SET(BOOST_COMPONENTS)
LIST(APPEND BOOST_COMPONENTS thread
date_time
system
filesystem
program_options
signals
serialization
chrono
unit_test_framework
context
locale)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
set(whole_archive_flag "-force_load") set(whole_archive_flag "-force_load")
...@@ -72,20 +58,24 @@ else() ...@@ -72,20 +58,24 @@ else()
set(no_whole_archive_flag "--no-whole-archive") set(no_whole_archive_flag "--no-whole-archive")
endif() endif()
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
IF( WIN32 ) IF( WIN32 )
SET(BOOST_ROOT $ENV{BOOST_ROOT}) SET(BOOST_ROOT $ENV{BOOST_ROOT})
set(Boost_USE_MULTITHREADED ON) set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF) # force dynamic linking for all libraries set(BOOST_ALL_DYN_LINK OFF) # force dynamic linking for all libraries
ENDIF(WIN32) ENDIF(WIN32)
FIND_PACKAGE(Boost 1.64 REQUIRED COMPONENTS
FIND_PACKAGE(Boost 1.64 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) thread
# For Boost 1.53 on windows, coroutine was not in BOOST_LIBRARYDIR and do not need it to build, but if boost versin >= 1.54, find coroutine otherwise will cause link errors date_time
IF(NOT "${Boost_VERSION}" MATCHES "1.53(.*)") system
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES}) filesystem
FIND_PACKAGE(Boost 1.54 REQUIRED COMPONENTS coroutine) program_options
LIST(APPEND BOOST_COMPONENTS coroutine) signals
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES}) serialization
ENDIF() chrono
unit_test_framework
context
locale)
if( WIN32 ) if( WIN32 )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册