Skip to content

Commit

Permalink
Fixed unnecessary search for boost library, when no benchmarks are build
Browse files Browse the repository at this point in the history
The boost library is unfortunately necessary for nonius under windows.
When invoking cmake with option: -DBUILD_BENCHMARKS=FALSE the boost library will not be searched anymore.

fixed #93
  • Loading branch information
acki-m committed Nov 27, 2017
1 parent 8337042 commit 54eb77a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions CMake/3rd_party_libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@ MESSAGE(STATUS ${LIBRARY_OUTPUT_DIRECTORY})
MESSAGE(STATUS "Finding 3rd party libs...")
MESSAGE(STATUS "===========================")

if (MSVC)
# there is a the moment a problem with finding multiple versions of boost,
# i.e. the static AND the static runtime version; that is not possible atm.
# Because of that, the benchmarks cannot be build with the static runtime lib option enabled
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(BOOST_ALL_DYN_LINK OFF)
if (BUILD_BENCHMARKS)
if (MSVC)
# there is a the moment a problem with finding multiple versions of boost,
# i.e. the static AND the static runtime version; that is not possible atm.
# Because of that, the benchmarks cannot be build with the static runtime lib option enabled
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(BOOST_ALL_DYN_LINK OFF)

find_package(Boost COMPONENTS chrono system)
else()
find_package(Boost)
find_package(Boost COMPONENTS chrono system)
else()
find_package(Boost)
endif()

find_package(Threads REQUIRED)
endif()

find_package(Threads REQUIRED)

set(RAPID_JSON_DIR ${RTTR_3RD_PARTY_DIR}/rapidjson-1.1.0)
set(CATCH_DIR ${RTTR_3RD_PARTY_DIR}/catch-1.8.2)
set(NONIUS_DIR ${RTTR_3RD_PARTY_DIR}/nonius-1.1.2)
Expand Down

0 comments on commit 54eb77a

Please sign in to comment.