]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
CMake: Replace CMAKE_COMPILER_IS_GNUCC with CMAKE_C_COMPILER_ID (#2550)
authorPeter Kokot <peterkokot@gmail.com>
Sat, 22 Mar 2025 21:21:38 +0000 (22:21 +0100)
committerGitHub <noreply@github.com>
Sat, 22 Mar 2025 21:21:38 +0000 (14:21 -0700)
Hello,

- The `CMAKE_COMPILER_IS_*` variables are deprecated and
`CMAKE_C_COMPILER_ID` can be used in this case instead.
- The legacy `endif()` command argument also simplified to avoid
repeating the condition.

build/cmake/LibarchiveCodeCoverage.cmake

index 297b886ccf055bfb0bd38948fda1f0f27a834482..efcf4ad4d241324e9394074c44f21c1d0e179d13 100644 (file)
 #    xdg-open coverage/index.html
 #################################################################
 
-# Find programs we need 
+# Find programs we need
 FIND_PROGRAM(LCOV_EXECUTABLE lcov DOC "Full path to lcov executable")
 FIND_PROGRAM(GENHTML_EXECUTABLE genhtml DOC "Full path to genhtml executable")
 MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE)
 
 # Check, compiler, build types and programs are available
-IF(NOT CMAKE_COMPILER_IS_GNUCC)
+IF(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU")
 MESSAGE(FATAL_ERROR "Coverage can only be built on GCC")
 ELSEIF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
 MESSAGE(FATAL_ERROR "Coverage can only be built in Debug mode")
@@ -33,7 +33,7 @@ ELSEIF(NOT LCOV_EXECUTABLE)
 MESSAGE(FATAL_ERROR "lcov executable not found")
 ELSEIF(NOT GENHTML_EXECUTABLE)
 MESSAGE(FATAL_ERROR "genhtml executable not found")
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
+ENDIF()
 
 # Enable testing if not already done
 SET(ENABLE_TEST ON)