@@ -12,44 +12,50 @@ else()
1212 FetchContent_MakeAvailable (Catch2)
1313endif ()
1414
15- # include aminya & jason turner's C++ best practices recommended cmake project utilities
16- include (FetchContent )
15+ if (RAPIDFUZZ_ENABLE_LINTERS)
16+ # include aminya & jason turner's C++ best practices recommended cmake project utilities
17+ message ("Enable Linters on test build" )
18+ include (FetchContent )
1719
18- if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
19- FetchContent_Declare (_project_options URL https://github.com/aminya/project_options/archive/refs/tags/v0.26.2.zip)
20- else ()
21- FetchContent_Declare (_project_options URL https://github.com/aminya/project_options/archive/refs/tags/v0.25.2.zip)
22- endif ()
23- FetchContent_MakeAvailable (_project_options)
24- include (${_project_options_SOURCE_DIR } /Index.cmake )
20+ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
21+ FetchContent_Declare (_project_options URL https://github.com/aminya/project_options/archive/refs/tags/v0.26.2.zip)
22+ else ()
23+ FetchContent_Declare (_project_options URL https://github.com/aminya/project_options/archive/refs/tags/v0.25.2.zip)
24+ endif ()
25+ FetchContent_MakeAvailable (_project_options)
26+ include (${_project_options_SOURCE_DIR } /Index.cmake )
2527
26- project_options (
27- # ENABLE_CACHE
28- # ENABLE_CONAN
29- WARNINGS_AS_ERRORS
30- # ENABLE_CPPCHECK
31- # ENABLE_CLANG_TIDY
32- # ENABLE_INCLUDE_WHAT_YOU_USE
33- # ENABLE_COVERAGE
34- # ENABLE_PCH
35- # PCH_HEADERS <Eigen/Dense> <fmt/core.h> <vector> <utility> <string> <string_view>
36- # ENABLE_DOXYGEN
37- # ENABLE_IPO
38- # ENABLE_USER_LINKER
39- # ENABLE_BUILD_WITH_TIME_TRACE
40- # ENABLE_UNITY
41- # ENABLE_SANITIZER_ADDRESS
42- # ENABLE_SANITIZER_LEAK
43- # ENABLE_SANITIZER_UNDEFINED_BEHAVIOR
44- # ENABLE_SANITIZER_THREAD
45- # ENABLE_SANITIZER_MEMORY
46- # CLANG_WARNINGS "-Weverything"
47- )
28+ project_options (
29+ # ENABLE_CACHE
30+ # ENABLE_CONAN
31+ WARNINGS_AS_ERRORS
32+ # ENABLE_CPPCHECK
33+ # ENABLE_CLANG_TIDY
34+ # ENABLE_INCLUDE_WHAT_YOU_USE
35+ # ENABLE_COVERAGE
36+ # ENABLE_PCH
37+ # PCH_HEADERS <Eigen/Dense> <fmt/core.h> <vector> <utility> <string> <string_view>
38+ # ENABLE_DOXYGEN
39+ # ENABLE_IPO
40+ # ENABLE_USER_LINKER
41+ # ENABLE_BUILD_WITH_TIME_TRACE
42+ # ENABLE_UNITY
43+ # ENABLE_SANITIZER_ADDRESS
44+ # ENABLE_SANITIZER_LEAK
45+ # ENABLE_SANITIZER_UNDEFINED_BEHAVIOR
46+ # ENABLE_SANITIZER_THREAD
47+ # ENABLE_SANITIZER_MEMORY
48+ # CLANG_WARNINGS "-Weverything"
49+ )
50+ endif ()
4851
4952function (rapidfuzz_add_test test )
5053 add_executable (test_${test} tests-${test}.cpp )
5154 target_link_libraries (test_${test} ${PROJECT_NAME } )
52- target_link_libraries (test_${test} Catch2::Catch2WithMain project_warnings )
55+ target_link_libraries (test_${test} Catch2::Catch2WithMain )
56+ if (RAPIDFUZZ_ENABLE_LINTERS)
57+ target_link_libraries (test_${test} project_warnings )
58+ endif ()
5359 add_test (NAME ${test} COMMAND test_${test} )
5460endfunction ()
5561
0 commit comments