diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b166ac59..a7cacd5a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -56,6 +56,12 @@ if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) integration ) + set( + all_targets + demo + integration + ) + set( unit_test_sources tests/unit/constexpr_contexts.cpp @@ -68,6 +74,7 @@ if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) ) foreach(test_file ${unit_test_sources}) get_filename_component(test_name ${test_file} NAME_WE) + list(APPEND all_targets ${test_name}) add_executable(${test_name} ${test_file}) target_link_libraries(${test_name} libassert-lib) add_test(NAME ${test_name} COMMAND ${test_name}) @@ -85,4 +92,14 @@ if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) ) endforeach(target ${dsym_targets}) endif() + + foreach(target ${all_targets}) + target_compile_options( + ${target_name} + PRIVATE + $<$>:-Wall -Wextra -Werror=return-type -Wshadow -Wundef -Werror> + $<$:-Wuseless-cast -Wnonnull-compare> + $<$:/W4 /WX /permissive-> + ) + endforeach() endif()