Skip to content

Commit

Permalink
Include 'CMake: Build tests only on make: Nothing to be done for 'tes…
Browse files Browse the repository at this point in the history
…t'. (#182)

Add EXCLUDE_FROM_ALL to test binaries as per the Boost convention'
  • Loading branch information
Flamefire committed May 16, 2024
1 parent 12651da commit 47df304
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2019 - 2021 Alexander Grund
# Copyright 2019 - 2024 Alexander Grund
# Distributed under the Nowide Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wsuggest-override _NOWIDE_SUGGEST_OVERRIDE_SUPPORTED)

add_library(nowide_file_test_helpers STATIC file_test_helpers.cpp)
add_library(nowide_file_test_helpers STATIC EXCLUDE_FROM_ALL file_test_helpers.cpp)
target_link_libraries(nowide_file_test_helpers PRIVATE nowide::nowide)
target_compile_definitions(nowide_file_test_helpers PRIVATE)

Expand All @@ -24,7 +24,7 @@ function(nowide_add_test name)
endif()
set(name ${PROJECT_NAME}-${name})

add_executable(${name} ${ARG_SRC})
add_executable(${name} EXCLUDE_FROM_ALL ${ARG_SRC})
add_dependencies(tests ${name})
target_link_libraries(${name} PRIVATE nowide::nowide ${ARG_LIBRARIES})
nowide_add_warnings(${name} pedantic ${NOWIDE_WERROR})
Expand Down

0 comments on commit 47df304

Please sign in to comment.