File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,9 +135,29 @@ else()
135135 set (BUILD_SHARED_LIBS ON )
136136 endif ()
137137
138- # link against dynamic boost libraries
139- add_definitions (-DBOOST_ALL_DYN_LINK )
140- add_definitions (-DBOOST_TEST_DYN_LINK )
138+ # link against static boost libraries
139+ if (NOT DEFINED Boost_USE_STATIC_LIBS)
140+ if (BUILD_SHARED_LIBS )
141+ set (Boost_USE_STATIC_LIBS 0)
142+ else ()
143+ set (Boost_USE_STATIC_LIBS 1)
144+ endif ()
145+ endif ()
146+
147+ # Boost static runtime ON for MSVC
148+ if (NOT DEFINED Boost_USE_STATIC_RUNTIME)
149+ if (BUILD_SHARED_LIBS )
150+ set (Boost_USE_STATIC_RUNTIME 0)
151+ else ()
152+ set (Boost_USE_STATIC_RUNTIME 1)
153+ endif ()
154+ endif ()
155+
156+ if (NOT Boost_USE_STATIC_LIBS)
157+ # link against dynamic boost libraries
158+ add_definitions (-DBOOST_ALL_DYN_LINK )
159+ add_definitions (-DBOOST_TEST_DYN_LINK )
160+ endif ()
141161
142162 # avoid a crash in valgrind that sometimes occurs if this flag is not defined
143163 add_definitions (-DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS )
You can’t perform that action at this time.
0 commit comments