diff options
| author | Vladislav Shchapov <vladislav@shchapov.ru> | 2026-01-10 00:01:03 +0500 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2026-01-11 10:32:39 +0100 |
| commit | 811df15509ba616352ec806c8e4398d61fdf2127 (patch) | |
| tree | 42dfb85979ea6d7553e5865264e7f3f8595f4b6a | |
| parent | 0ca621a29252167b48a0e351a5e542a25a6b1535 (diff) | |
| download | Project-Tick-811df15509ba616352ec806c8e4398d61fdf2127.tar.gz Project-Tick-811df15509ba616352ec806c8e4398d61fdf2127.zip | |
Remove always TRUE or FALSE CMake version checks
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
| -rw-r--r-- | cmake/detect-coverage.cmake | 14 | ||||
| -rw-r--r-- | cmake/fallback-macros.cmake | 15 | ||||
| -rw-r--r-- | test/CMakeLists.txt | 2 |
3 files changed, 3 insertions, 28 deletions
diff --git a/cmake/detect-coverage.cmake b/cmake/detect-coverage.cmake index 8e67a085cd..86e59f0bad 100644 --- a/cmake/detect-coverage.cmake +++ b/cmake/detect-coverage.cmake @@ -3,13 +3,8 @@ macro(add_code_coverage) # Check for -coverage flag support for Clang/GCC - if(CMAKE_VERSION VERSION_LESS 3.14) - set(CMAKE_REQUIRED_LIBRARIES -lgcov) - else() - set(CMAKE_REQUIRED_LINK_OPTIONS -coverage) - endif() + set(CMAKE_REQUIRED_LINK_OPTIONS -coverage) check_c_compiler_flag(-coverage HAVE_COVERAGE) - set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LINK_OPTIONS) if(HAVE_COVERAGE) @@ -18,13 +13,8 @@ macro(add_code_coverage) message(STATUS "Code coverage enabled using: -coverage") else() # Some versions of GCC don't support -coverage shorthand - if(CMAKE_VERSION VERSION_LESS 3.14) - set(CMAKE_REQUIRED_LIBRARIES -lgcov) - else() - set(CMAKE_REQUIRED_LINK_OPTIONS -lgcov -fprofile-arcs) - endif() + set(CMAKE_REQUIRED_LINK_OPTIONS -lgcov -fprofile-arcs) check_c_compiler_flag("-ftest-coverage -fprofile-arcs -fprofile-values" HAVE_TEST_COVERAGE) - set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LINK_OPTIONS) if(HAVE_TEST_COVERAGE) diff --git a/cmake/fallback-macros.cmake b/cmake/fallback-macros.cmake index 8bc6cf25be..e8af0d4fe5 100644 --- a/cmake/fallback-macros.cmake +++ b/cmake/fallback-macros.cmake @@ -2,18 +2,3 @@ # Copyright (C) 2022 Nathan Moinvaziri # Licensed under the Zlib license, see LICENSE.md for details -# CMake less than version 3.5.2 -if(NOT COMMAND add_compile_options) - macro(add_compile_options options) - string(APPEND CMAKE_C_FLAGS ${options}) - string(APPEND CMAKE_CXX_FLAGS ${options}) - endmacro() -endif() - -# CMake less than version 3.14 -if(NOT COMMAND add_link_options) - macro(add_link_options options) - string(APPEND CMAKE_EXE_LINKER_FLAGS ${options}) - string(APPEND CMAKE_SHARED_LINKER_FLAGS ${options}) - endmacro() -endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bbaf1035c2..eacea5ead7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -110,7 +110,7 @@ if(WITH_GTEST) find_package(GTest) endif() - if(NOT TARGET GTest::GTest AND NOT CMAKE_VERSION VERSION_LESS 3.11) + if(NOT TARGET GTest::GTest) include(FetchContent) # Prevent overriding the parent project's compiler/linker settings for Windows |
