Browse Source

Changes to static build (related to #270).

pull/271/head
EinMByte 9 years ago
parent
commit
c9080f9f72
  1. 17
      CMakeLists.txt

17
CMakeLists.txt

@ -99,17 +99,8 @@ endif()
if(WITH_STATIC) if(WITH_STATIC)
set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON) set(Boost_USE_STATIC_RUNTIME OFF)
if(WIN32) if(NOT WIN32)
# http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace
# Note that you might need to rebuild Crypto++
foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a) set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif() endif()
@ -126,10 +117,10 @@ elseif(NOT WIN32)
# No need in -fPIC overhead for binary if not interested in library # No need in -fPIC overhead for binary if not interested in library
# HINT: revert c266cff CMakeLists.txt: compilation speed up # HINT: revert c266cff CMakeLists.txt: compilation speed up
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
else() # Not a static build
add_definitions(-DBOOST_ALL_DYN_LINK)
endif() endif()
add_definitions(-DBOOST_ALL_DYN_LINK)
find_package( find_package(
Boost COMPONENTS Boost COMPONENTS
system filesystem regex program_options date_time thread chrono REQUIRED system filesystem regex program_options date_time thread chrono REQUIRED

Loading…
Cancel
Save