[PATCH] D47833: [CMake] Pass additional CMake tools to external projects
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 6 14:48:08 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL334136: [CMake] Pass additional CMake tools to external projects (authored by phosek, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D47833?vs=150157&id=150205#toc
Repository:
rL LLVM
https://reviews.llvm.org/D47833
Files:
llvm/trunk/cmake/modules/LLVMExternalProjectUtils.cmake
llvm/trunk/runtimes/CMakeLists.txt
Index: llvm/trunk/cmake/modules/LLVMExternalProjectUtils.cmake
===================================================================
--- llvm/trunk/cmake/modules/LLVMExternalProjectUtils.cmake
+++ llvm/trunk/cmake/modules/LLVMExternalProjectUtils.cmake
@@ -46,7 +46,7 @@
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-ranlib)
+ list(APPEND ARG_TOOLCHAIN_TOOLS llvm-ar llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip)
endif()
endif()
foreach(tool ${ARG_TOOLCHAIN_TOOLS})
@@ -107,12 +107,27 @@
set(compiler_args -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
-DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
endif()
+ if(lld IN_LIST TOOLCHAIN_TOOLS)
+ list(APPEND compiler_args -DCMAKE_LINKER=${LLVM_RUNTIME_OUTPUT_INTDIR}/ld.lld)
+ endif()
if(llvm-ar IN_LIST TOOLCHAIN_TOOLS)
list(APPEND compiler_args -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar)
endif()
if(llvm-ranlib IN_LIST TOOLCHAIN_TOOLS)
list(APPEND compiler_args -DCMAKE_RANLIB=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib)
endif()
+ if(llvm-nm IN_LIST TOOLCHAIN_TOOLS)
+ list(APPEND compiler_args -DCMAKE_NM=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-nm)
+ endif()
+ if(llvm-objdump IN_LIST TOOLCHAIN_TOOLS)
+ list(APPEND compiler_args -DCMAKE_OBJDUMP=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-objdump)
+ endif()
+ if(llvm-objcopy IN_LIST TOOLCHAIN_TOOLS)
+ list(APPEND compiler_args -DCMAKE_OBJCOPY=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-objcopy)
+ endif()
+ if(llvm-strip IN_LIST TOOLCHAIN_TOOLS)
+ list(APPEND compiler_args -DCMAKE_STRIP=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-strip)
+ endif()
list(APPEND ARG_DEPENDS ${TOOLCHAIN_TOOLS})
endif()
@@ -139,8 +154,13 @@
if(CMAKE_CROSSCOMPILING)
set(compiler_args -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+ -DCMAKE_LINKER=${CMAKE_LINKER}
-DCMAKE_AR=${CMAKE_AR}
- -DCMAKE_RANLIB=${CMAKE_RANLIB})
+ -DCMAKE_RANLIB=${CMAKE_RANLIB}
+ -DCMAKE_NM=${CMAKE_NM}
+ -DCMAKE_OBJCOPY=${CMAKE_OBJCOPY}
+ -DCMAKE_OBJDUMP=${CMAKE_OBJDUMP}
+ -DCMAKE_STRIP=${CMAKE_STRIP})
set(llvm_config_path ${LLVM_CONFIG_PATH})
else()
set(llvm_config_path "$<TARGET_FILE:llvm-config>")
Index: llvm/trunk/runtimes/CMakeLists.txt
===================================================================
--- llvm/trunk/runtimes/CMakeLists.txt
+++ llvm/trunk/runtimes/CMakeLists.txt
@@ -285,7 +285,7 @@
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
${${target}_extra_args}
PASSTHROUGH_PREFIXES CLANG_DEFAULT
- TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib
+ TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip
USE_TOOLCHAIN
${EXTRA_ARGS})
endfunction()
@@ -463,7 +463,7 @@
${${name}_extra_args}
PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES
CLANG_DEFAULT
- TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib
+ TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip
EXTRA_TARGETS ${${name}_extra_targets}
${${name}_test_targets}
USE_TOOLCHAIN
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47833.150205.patch
Type: text/x-patch
Size: 3900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180606/210f3968/attachment.bin>
More information about the llvm-commits
mailing list