[PATCH] D133482: [LLVM] Fix GetErrcMessages.cmake module for WoA

Muhammad Omair Javaid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 02:41:38 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb816895b0efc: [LLVM] Fix GetErrcMessages.cmake module for WoA (authored by omjavaid).

Changed prior to commit:
  https://reviews.llvm.org/D133482?vs=459425&id=463471#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133482/new/

https://reviews.llvm.org/D133482

Files:
  llvm/CMakeLists.txt


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -105,6 +105,20 @@
 ")
 endif()
 
+# Set default build type for cmake's try_compile module.
+# CMake 3.17 or newer sets CMAKE_DEFAULT_BUILD_TYPE to one of the
+# items from CMAKE_CONFIGURATION_TYPES. Logic below can be further
+# simplified once LLVM's minimum CMake version is updated to 3.17.
+if(CMAKE_DEFAULT_BUILD_TYPE)
+  set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_DEFAULT_BUILD_TYPE})
+else()
+  if(CMAKE_CONFIGURATION_TYPES)
+    list(GET CMAKE_CONFIGURATION_TYPES 0 CMAKE_TRY_COMPILE_CONFIGURATION)
+  elseif(CMAKE_BUILD_TYPE)
+    set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
+  endif()
+endif()
+
 # Side-by-side subprojects layout: automatically set the
 # LLVM_EXTERNAL_${project}_SOURCE_DIR using LLVM_ALL_PROJECTS
 # This allows an easy way of setting up a build directory for llvm and another


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133482.463471.patch
Type: text/x-patch
Size: 967 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220928/55028497/attachment.bin>


More information about the llvm-commits mailing list