Skip to content

Commit 9cddfe3

Browse files
committed
[CMake] Passthrough OSX CMake options to builtins and runtimes
When using the default target, there's no other way to pass these into the builtins and runtimes subbuilds. Differential Revision: https://reviews.llvm.org/D116976
1 parent 4f547ee commit 9cddfe3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

llvm/runtimes/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ function(builtin_default_target compiler_rt_path)
9090
-DCMAKE_ASM_COMPILER_WORKS=ON
9191
${COMMON_CMAKE_ARGS}
9292
${BUILTINS_CMAKE_ARGS}
93-
PASSTHROUGH_PREFIXES COMPILER_RT
93+
PASSTHROUGH_PREFIXES CMAKE_OSX
94+
COMPILER_RT
95+
DARWIN
96+
SANITIZER
9497
USE_TOOLCHAIN
9598
TARGET_TRIPLE ${TARGET_TRIPLE}
9699
${EXTRA_ARGS})
@@ -181,10 +184,10 @@ foreach(entry ${runtimes})
181184
if (${canon_name} STREQUAL "OPENMP")
182185
list(APPEND prefixes "LIBOMP" "LIBOMPTARGET")
183186
endif()
184-
# Many compiler-rt options start with SANITIZER_ rather than COMPILER_RT_,
185-
# so when compiler-rt is enabled, consider both.
187+
# Many compiler-rt options start with SANITIZER_ and DARWIN_ rather than
188+
# COMPILER_RT_, so when compiler-rt is enabled, consider both.
186189
if(canon_name STREQUAL "COMPILER_RT")
187-
list(APPEND prefixes SANITIZER)
190+
list(APPEND prefixes SANITIZER DARWIN)
188191
endif()
189192

190193
string(FIND ${projName} "lib" LIB_IDX)
@@ -241,7 +244,8 @@ function(runtime_default_target)
241244
-DCMAKE_ASM_COMPILER_WORKS=ON
242245
${COMMON_CMAKE_ARGS}
243246
${RUNTIMES_CMAKE_ARGS}
244-
PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES
247+
PASSTHROUGH_PREFIXES CMAKE_OSX
248+
LLVM_ENABLE_RUNTIMES
245249
LLVM_USE_LINKER
246250
${ARG_PREFIXES}
247251
EXTRA_TARGETS ${extra_targets}

0 commit comments

Comments
 (0)