[PATCH] D122161: [cmake] Handle iOS, watchOS and tvOS when finding compiler-rt on Apple
Louis Dionne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 21 10:45:58 PDT 2022
ldionne created this revision.
ldionne added reviewers: phosek, beanz.
Herald added subscribers: mgorny, dberris.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch uses CMAKE_OSX_SYSROOT, which should contain the SDK path
that we're building against on Apple platforms, to determine which
platform we are compiling for and set the compiler-rt suffix accordingly.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D122161
Files:
cmake/Modules/HandleCompilerRT.cmake
Index: cmake/Modules/HandleCompilerRT.cmake
===================================================================
--- cmake/Modules/HandleCompilerRT.cmake
+++ cmake/Modules/HandleCompilerRT.cmake
@@ -20,8 +20,17 @@
if(NOT name MATCHES "builtins.*")
set(component_name "${name}_")
endif()
- # TODO: Support ios, tvos and watchos as well.
- set(component_name "${component_name}osx")
+ if (CMAKE_OSX_SYSROOT MATCHES ".+MacOSX.+")
+ set(component_name "${component_name}osx")
+ elseif (CMAKE_OSX_SYSROOT MATCHES ".+iPhoneOS.+")
+ set(component_name "${component_name}ios")
+ elseif (CMAKE_OSX_SYSROOT MATCHES ".+AppleTVOS.+")
+ set(component_name "${component_name}tvos")
+ elseif (CMAKE_OSX_SYSROOT MATCHES ".+WatchOS.+")
+ set(component_name "${component_name}watchos")
+ else()
+ message(FATAL_ERROR "Unknown Apple SDK ${CMAKE_OSX_SYSROOT}, we don't know which compiler-rt library suffix to use.")
+ endif()
else()
set(component_name "${name}")
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122161.417027.patch
Type: text/x-patch
Size: 1028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220321/008e917c/attachment.bin>
More information about the llvm-commits
mailing list