From 3b613563d30d99adcb8410af36b1ffc928bc947b Mon Sep 17 00:00:00 2001 From: Vollstrecker Date: Wed, 25 Dec 2024 09:07:14 +0100 Subject: CMake: Prefix coverage test name with zlib. --- test/CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3fffe9e..1f399f4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -61,6 +61,9 @@ if(ZLIB_BUILD_STATIC) if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") + set(CFLAGS_OLD ${CMAKE_C_FLAGS}) + set({CMAKE_C_FLAGS "" CACHE STRING "" FORCE) + if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") find_program(GCOV_EXECUTABLE gcov) endif(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") @@ -83,14 +86,15 @@ if(ZLIB_BUILD_STATIC) target_compile_definitions(infcover PRIVATE $<$:HAVE_HIDDEN>) - add_test (NAME coverage COMMAND infcover) - set (INFCOVER_DIR - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/infcover.dir) - add_test (NAME coverage-summary - COMMAND ${GCOV_EXECUTABLE} ${llvm_option} - ${CMAKE_CURRENT_SOURCE_DIR}/infcover.c - -o ${INFCOVER_DIR}/infcover.c.gcda) - set_tests_properties(coverage-summary PROPERTIES DEPENDS incover) + add_test (NAME zlib-coverage COMMAND infcover) + set (INFCOVER_DIR + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/infcover.dir) + add_test (NAME zlib-coverage-summary + COMMAND ${GCOV_EXECUTABLE} ${llvm_option} + ${CMAKE_CURRENT_SOURCE_DIR}/infcover.c + -o ${INFCOVER_DIR}/infcover.c.gcda) + set_tests_properties(zlib-coverage-summary PROPERTIES DEPENDS zlib-coverage) + set({CMAKE_C_FLAGS ${CFLAGS_OLD} CACHE STRING "" FORCE) endif(${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") -- cgit v1.2.3-55-g6feb