Skip to content

Commit

Permalink
don't build tests in CMake by default
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed May 14, 2024
1 parent 1f6f1a2 commit e6cc8b2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


if(NOT TARGET tests)
add_custom_target(tests)
add_custom_target(tests EXCLUDE_FROM_ALL)
set_property(TARGET tests PROPERTY FOLDER _deps)
endif()

Expand All @@ -23,7 +23,7 @@ list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX limits\.cpp$)
list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX no_exceptions\.cpp$)

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${BOOST_JSON_TESTS_FILES})
add_executable(boost_json-tests ${BOOST_JSON_TESTS_FILES})
add_executable(boost_json-tests EXCLUDE_FROM_ALL ${BOOST_JSON_TESTS_FILES})
target_include_directories(boost_json-tests PRIVATE .)
target_link_libraries(boost_json-tests PRIVATE Boost::json)
target_compile_options(boost_json-tests PRIVATE
Expand All @@ -35,7 +35,7 @@ add_dependencies(tests boost_json-tests)

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES limits.cpp main.cpp intrusive_macros.cpp)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../src PREFIX "" FILES ../src/src.cpp)
add_executable(boost_json-limits limits.cpp main.cpp ../src/src.cpp Jamfile)
add_executable(boost_json-limits EXCLUDE_FROM_ALL limits.cpp main.cpp ../src/src.cpp Jamfile)
boost_json_setup_properties(boost_json-limits)

target_compile_definitions(boost_json-limits PRIVATE
Expand All @@ -48,7 +48,7 @@ target_compile_definitions(boost_json-limits PRIVATE
add_test(NAME boost_json-limits COMMAND boost_json-limits)
add_dependencies(tests boost_json-limits)

add_executable(boost_json-no_exceptions no_exceptions.cpp main.cpp ../src/src.cpp Jamfile)
add_executable(boost_json-no_exceptions EXCLUDE_FROM_ALL no_exceptions.cpp main.cpp ../src/src.cpp Jamfile)
boost_json_setup_properties(boost_json-no_exceptions)

target_compile_definitions(boost_json-no_exceptions PRIVATE
Expand All @@ -63,7 +63,7 @@ target_compile_options(boost_json-no_exceptions PRIVATE
add_test(NAME boost_json-no_exceptions COMMAND boost_json-no_exceptions)
add_dependencies(tests boost_json-no_exceptions)

add_executable(boost_json-intrusive-macro-tests intrusive_macros.cpp main.cpp Jamfile)
add_executable(boost_json-intrusive-macro-tests EXCLUDE_FROM_ALL intrusive_macros.cpp main.cpp Jamfile)
boost_json_setup_properties(boost_json-intrusive-macro-tests)
target_compile_definitions(boost_json-intrusive-macro-tests PRIVATE
BOOST_JSON_NO_LIB=1
Expand Down

0 comments on commit e6cc8b2

Please sign in to comment.