llvm.org GIT mirror llvm / 957e46d
[CMake] Pass additional CMake tools to external projects This is needed when the external projects try to use other tools besides just the compiler and the linker. Differential Revision: https://reviews.llvm.org/D47833 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334136 91177308-0d34-0410-b5e6-96231b3b80d8 Petr Hosek 1 year, 3 months ago
2 changed file(s) with 24 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
4545 if(NOT ARG_TOOLCHAIN_TOOLS)
4646 set(ARG_TOOLCHAIN_TOOLS clang lld)
4747 if(NOT APPLE AND NOT WIN32)
48 list(APPEND ARG_TOOLCHAIN_TOOLS llvm-ar llvm-ranlib)
48 list(APPEND ARG_TOOLCHAIN_TOOLS llvm-ar llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip)
4949 endif()
5050 endif()
5151 foreach(tool ${ARG_TOOLCHAIN_TOOLS})
106106 set(compiler_args -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
107107 -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
108108 endif()
109 if(lld IN_LIST TOOLCHAIN_TOOLS)
110 list(APPEND compiler_args -DCMAKE_LINKER=${LLVM_RUNTIME_OUTPUT_INTDIR}/ld.lld)
111 endif()
109112 if(llvm-ar IN_LIST TOOLCHAIN_TOOLS)
110113 list(APPEND compiler_args -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar)
111114 endif()
112115 if(llvm-ranlib IN_LIST TOOLCHAIN_TOOLS)
113116 list(APPEND compiler_args -DCMAKE_RANLIB=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib)
117 endif()
118 if(llvm-nm IN_LIST TOOLCHAIN_TOOLS)
119 list(APPEND compiler_args -DCMAKE_NM=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-nm)
120 endif()
121 if(llvm-objdump IN_LIST TOOLCHAIN_TOOLS)
122 list(APPEND compiler_args -DCMAKE_OBJDUMP=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-objdump)
123 endif()
124 if(llvm-objcopy IN_LIST TOOLCHAIN_TOOLS)
125 list(APPEND compiler_args -DCMAKE_OBJCOPY=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-objcopy)
126 endif()
127 if(llvm-strip IN_LIST TOOLCHAIN_TOOLS)
128 list(APPEND compiler_args -DCMAKE_STRIP=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-strip)
114129 endif()
115130 list(APPEND ARG_DEPENDS ${TOOLCHAIN_TOOLS})
116131 endif()
138153 if(CMAKE_CROSSCOMPILING)
139154 set(compiler_args -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
140155 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
156 -DCMAKE_LINKER=${CMAKE_LINKER}
141157 -DCMAKE_AR=${CMAKE_AR}
142 -DCMAKE_RANLIB=${CMAKE_RANLIB})
158 -DCMAKE_RANLIB=${CMAKE_RANLIB}
159 -DCMAKE_NM=${CMAKE_NM}
160 -DCMAKE_OBJCOPY=${CMAKE_OBJCOPY}
161 -DCMAKE_OBJDUMP=${CMAKE_OBJDUMP}
162 -DCMAKE_STRIP=${CMAKE_STRIP})
143163 set(llvm_config_path ${LLVM_CONFIG_PATH})
144164 else()
145165 set(llvm_config_path "$")
284284 -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
285285 ${${target}_extra_args}
286286 PASSTHROUGH_PREFIXES CLANG_DEFAULT
287 TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib
287 TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip
288288 USE_TOOLCHAIN
289289 ${EXTRA_ARGS})
290290 endfunction()
462462 ${${name}_extra_args}
463463 PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES
464464 CLANG_DEFAULT
465 TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib
465 TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip
466466 EXTRA_TARGETS ${${name}_extra_targets}
467467 ${${name}_test_targets}
468468 USE_TOOLCHAIN