[Openmp-commits] [PATCH] D112951: [OpenMP][libomp][CMake] set and use uppercase_CMAKE_BUILD_TYPE

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 1 12:28:19 PDT 2021


jlpeyton created this revision.
jlpeyton added reviewers: AndreyChurbanov, tlwilmar.
jlpeyton added a project: OpenMP.
Herald added subscribers: guansong, yaxunl, mgorny.
jlpeyton requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112951

Files:
  openmp/runtime/CMakeLists.txt


Index: openmp/runtime/CMakeLists.txt
===================================================================
--- openmp/runtime/CMakeLists.txt
+++ openmp/runtime/CMakeLists.txt
@@ -34,6 +34,7 @@
   # 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(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()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112951.383859.patch
Type: text/x-patch
Size: 1327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20211101/01e969e8/attachment.bin>


More information about the Openmp-commits mailing list