[PATCH] D30957: [CMake] Support single target builtins build on Darwin
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 21 14:01:52 PDT 2017
phosek updated this revision to Diff 92541.
phosek marked an inline comment as done.
Repository:
rL LLVM
https://reviews.llvm.org/D30957
Files:
runtimes/CMakeLists.txt
Index: runtimes/CMakeLists.txt
===================================================================
--- runtimes/CMakeLists.txt
+++ runtimes/CMakeLists.txt
@@ -61,6 +61,10 @@
# This variable makes sure that e.g. llvm-lit is found.
set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR})
+ if(APPLE)
+ set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
+ endif()
+
# Handle common options used by all runtimes.
include(AddLLVM)
include(HandleLLVMOptions)
@@ -149,7 +153,7 @@
# is required because the other runtimes need the builtin libraries present
# before the just-built compiler can pass the configuration tests.
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt)
- if(APPLE OR NOT LLVM_BUILTIN_TARGETS)
+ if(NOT LLVM_BUILTIN_TARGETS)
llvm_ExternalProject_Add(builtins
${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt/lib/builtins
CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR}
@@ -162,6 +166,14 @@
get_cmake_property(variableNames VARIABLES)
add_custom_target(builtins)
foreach(target ${LLVM_BUILTIN_TARGETS})
+ string(REPLACE "-" ";" builtin_target_list ${target})
+ foreach(item ${builtin_target_list})
+ string(TOLOWER "${item}" item_lower)
+ if(item_lower MATCHES "darwin")
+ message(FATAL_ERROR "LLVM_BUILTIN_TARGETS isn't implemented for Darwin platform!")
+ endif()
+ endforeach()
+
foreach(variableName ${variableNames})
if(variableName MATCHES "^BUILTINS_${target}")
string(REPLACE "BUILTINS_${target}_" "" new_name ${variableName})
@@ -178,6 +190,7 @@
-DCMAKE_ASM_COMPILER_WORKS=On
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=On
${${target}_extra_args}
+ TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib
PASSTHROUGH_PREFIXES COMPILER_RT
USE_TOOLCHAIN)
add_dependencies(builtins builtins-${target})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30957.92541.patch
Type: text/x-patch
Size: 2139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170321/b7e29784/attachment.bin>
More information about the llvm-commits
mailing list