[PATCH] D116976: [CMake] Passthrough OSX CMake options to builtins and runtimes

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 14:55:13 PST 2022


phosek created this revision.
phosek added reviewers: smeenai, beanz.
Herald added a subscriber: mgorny.
phosek requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When using the default target, there's no other way to pass these
into the builtins and runtimes subbuilds.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116976

Files:
  llvm/runtimes/CMakeLists.txt


Index: llvm/runtimes/CMakeLists.txt
===================================================================
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -90,7 +90,8 @@
                                       -DCMAKE_ASM_COMPILER_WORKS=ON
                                       ${COMMON_CMAKE_ARGS}
                                       ${BUILTINS_CMAKE_ARGS}
-                           PASSTHROUGH_PREFIXES COMPILER_RT
+                           PASSTHROUGH_PREFIXES CMAKE_OSX
+                                                COMPILER_RT
                            USE_TOOLCHAIN
                            TARGET_TRIPLE ${TARGET_TRIPLE}
                            ${EXTRA_ARGS})
@@ -181,10 +182,10 @@
   if (${canon_name} STREQUAL "OPENMP")
     list(APPEND prefixes "LIBOMP" "LIBOMPTARGET")
   endif()
-  # Many compiler-rt options start with SANITIZER_ rather than COMPILER_RT_,
-  # so when compiler-rt is enabled, consider both.
+  # Many compiler-rt options start with SANITIZER_ and DARWIN_ rather than
+  # COMPILER_RT_, so when compiler-rt is enabled, consider both.
   if(canon_name STREQUAL "COMPILER_RT")
-    list(APPEND prefixes SANITIZER)
+    list(APPEND prefixes SANITIZER DARWIN)
   endif()
 
   string(FIND ${projName} "lib" LIB_IDX)
@@ -241,7 +242,8 @@
                                       -DCMAKE_ASM_COMPILER_WORKS=ON
                                       ${COMMON_CMAKE_ARGS}
                                       ${RUNTIMES_CMAKE_ARGS}
-                           PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES
+                           PASSTHROUGH_PREFIXES CMAKE_OSX
+                                                LLVM_ENABLE_RUNTIMES
                                                 LLVM_USE_LINKER
                                                 ${ARG_PREFIXES}
                            EXTRA_TARGETS ${extra_targets}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116976.398750.patch
Type: text/x-patch
Size: 1876 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220110/8769b815/attachment.bin>


More information about the llvm-commits mailing list