From e08595c9104f1eb44e3b868e14f4e8519b634ac2 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Mon, 22 Jul 2024 10:05:59 -0500 Subject: [PATCH] Accept arbitrary capitalization for coverage build type (#435) Signed-off-by: Addisu Z. Taddese (cherry picked from commit 916a9176e74b0895eda255fc666ffc65cf828911) --- cmake/IgnCodeCoverage.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/IgnCodeCoverage.cmake b/cmake/IgnCodeCoverage.cmake index 20691d01..f922cae0 100644 --- a/cmake/IgnCodeCoverage.cmake +++ b/cmake/IgnCodeCoverage.cmake @@ -56,7 +56,9 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX) ENDIF() ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX -IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage")) +# Convert to uppercase in order to support arbitrary capitalization +string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPERCASE) +IF ( NOT (CMAKE_BUILD_TYPE_UPPERCASE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE_UPPERCASE STREQUAL "COVERAGE")) MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" ) ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"