[PATCH] D74107: [CMake] Use llvm-ar etal for external project build on Darwin
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 6 13:57:59 PST 2020
phosek updated this revision to Diff 242999.
Herald added a reviewer: alexshap.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74107/new/
https://reviews.llvm.org/D74107
Files:
llvm/cmake/modules/LLVMExternalProjectUtils.cmake
Index: llvm/cmake/modules/LLVMExternalProjectUtils.cmake
===================================================================
--- llvm/cmake/modules/LLVMExternalProjectUtils.cmake
+++ llvm/cmake/modules/LLVMExternalProjectUtils.cmake
@@ -45,10 +45,18 @@
"CMAKE_ARGS;TOOLCHAIN_TOOLS;RUNTIME_LIBRARIES;DEPENDS;EXTRA_TARGETS;PASSTHROUGH_PREFIXES;STRIP_TOOL"
${ARGN})
canonicalize_tool_name(${name} nameCanon)
+
+ foreach(arg ${ARG_CMAKE_ARGS})
+ if(arg MATCHES "^-DCMAKE_SYSTEM_NAME=")
+ string(REGEX REPLACE "^-DCMAKE_SYSTEM_NAME=(.*)$" "\\1" _cmake_system_name "${arg}")
+ endif()
+ endforeach()
+
if(NOT ARG_TOOLCHAIN_TOOLS)
- set(ARG_TOOLCHAIN_TOOLS clang lld)
- if(NOT APPLE AND NOT WIN32)
- list(APPEND ARG_TOOLCHAIN_TOOLS llvm-ar llvm-lipo llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip)
+ set(ARG_TOOLCHAIN_TOOLS clang lld llvm-ar llvm-lipo llvm-ranlib llvm-nm llvm-objdump)
+ if(NOT _cmake_system_name STREQUAL Darwin)
+ # TODO: These tools don't fully support Mach-O format yet.
+ list(APPEND ARG_TOOLCHAIN_TOOLS llvm-objcopy llvm-strip)
endif()
endif()
foreach(tool ${ARG_TOOLCHAIN_TOOLS})
@@ -104,12 +112,6 @@
endforeach()
endforeach()
- foreach(arg ${ARG_CMAKE_ARGS})
- if(arg MATCHES "^-DCMAKE_SYSTEM_NAME=")
- string(REGEX REPLACE "^-DCMAKE_SYSTEM_NAME=(.*)$" "\\1" _cmake_system_name "${arg}")
- endif()
- endforeach()
-
if(ARG_USE_TOOLCHAIN AND NOT CMAKE_CROSSCOMPILING)
if(CLANG_IN_TOOLCHAIN)
if(_cmake_system_name STREQUAL Windows)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74107.242999.patch
Type: text/x-patch
Size: 1562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200206/7bfe5163/attachment.bin>
More information about the llvm-commits
mailing list