Add option to disable performance test build

This commit is contained in:
Shane Grant 2019-10-23 22:04:42 -07:00
parent 797239531b
commit 1bce4362db
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 2.6.2)
project (cereal)
option(SKIP_PORTABILITY_TEST "Skip portability (32 bit) tests" OFF)
option(SKIP_PERFORMANCE_COMPARISON "Skip building performance comparison (requires boost)" OFF)
if(NOT CMAKE_VERSION VERSION_LESS 3.0) # installing cereal requires INTERFACE lib
option(JUST_INSTALL_CEREAL "Don't do anything besides installing the library" OFF)
endif()

View File

@ -8,10 +8,10 @@ add_executable(sandbox_vs sandbox_vs.cpp)
target_link_libraries(sandbox_vs sandbox_vs_dll)
include_directories(sandbox_shared_lib)
if(Boost_FOUND)
if((Boost_FOUND) AND NOT SKIP_PERFORMANCE_COMPARISON)
add_executable(performance performance.cpp)
if(MSVC)
set_target_properties(performance PROPERTIES COMPILE_DEFINITIONS "BOOST_SERIALIZATION_DYN_LINK")
endif()
target_link_libraries(performance ${Boost_LIBRARIES})
endif(Boost_FOUND)
endif()