From 48b67dca2cccb4898819797240677f490edcf026 Mon Sep 17 00:00:00 2001 From: Jonathan Peyton Date: Mon, 1 Nov 2021 14:23:54 -0500 Subject: [PATCH] [OpenMP][libomp][CMake] use uppercase_CMAKE_BUILD_TYPE Have standalone builds define uppercase_CMAKE_BUILD_TYPE and use it. llvm/CMakeLists.txt defines uppercase_CMAKE_BUILD_TYPE for regular LLVM builds with OpenMP enabled. Differential Revision: https://reviews.llvm.org/D112951 --- openmp/runtime/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt index 44a1095..136cd60 100644 --- a/openmp/runtime/CMakeLists.txt +++ b/openmp/runtime/CMakeLists.txt @@ -34,6 +34,7 @@ if(${OPENMP_STANDALONE_BUILD}) # Should assertions be enabled? They are on by default. set(LIBOMP_ENABLE_ASSERTIONS TRUE CACHE BOOL "enable assertions?") + string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) else() # Part of LLVM build # Determine the native architecture from LLVM. string(TOLOWER "${LLVM_TARGET_ARCH}" LIBOMP_NATIVE_ARCH) @@ -189,14 +190,13 @@ set(RELEASE_BUILD FALSE) set(DEBUG_BUILD FALSE) set(RELWITHDEBINFO_BUILD FALSE) set(MINSIZEREL_BUILD FALSE) -string(TOLOWER "${CMAKE_BUILD_TYPE}" libomp_build_type_lowercase) -if("${libomp_build_type_lowercase}" STREQUAL "release") +if("${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "RELEASE") set(RELEASE_BUILD TRUE) -elseif("${libomp_build_type_lowercase}" STREQUAL "debug") +elseif("${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") set(DEBUG_BUILD TRUE) -elseif("${libomp_build_type_lowercase}" STREQUAL "relwithdebinfo") +elseif("${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "RELWITHDEBINFO") set(RELWITHDEBINFO_BUILD TRUE) -elseif("${libomp_build_type_lowercase}" STREQUAL "minsizerel") +elseif("${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "MINSIZEREL") set(MINSIZEREL_BUILD TRUE) endif() -- 2.7.4