[Openmp-commits] [openmp] 48b67dc - [OpenMP][libomp][CMake] use uppercase_CMAKE_BUILD_TYPE

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Tue Nov 9 09:04:01 PST 2021


Author: Jonathan Peyton
Date: 2021-11-09T11:03:04-06:00
New Revision: 48b67dca2cccb4898819797240677f490edcf026

URL: https://github.com/llvm/llvm-project/commit/48b67dca2cccb4898819797240677f490edcf026
DIFF: https://github.com/llvm/llvm-project/commit/48b67dca2cccb4898819797240677f490edcf026.diff

LOG: [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

Added: 
    

Modified: 
    openmp/runtime/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt
index 44a1095c4ed3..136cd6018dd3 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()
 


        


More information about the Openmp-commits mailing list