mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Add option LLVM_NM to allow specifying the location of the llvm-nm tool
The new option works like the existing LLVM_TABLEGEN, and LLVM_CONFIG_PATH options. Instead of building llvm-nm, the build uses the executable defined by LLVM_NM. This is useful for cross-compilation scenarios where the host cannot run the cross-compiled tool, and recursing into another cmake build is not an option (due to required DEFINE's, for example). Reviewed By: smeenai Differential Revision: https://reviews.llvm.org/D83022
This commit is contained in:
parent
c554e8d06e
commit
07457fd3ce
@ -154,7 +154,7 @@ if(LLVM_BUILD_LLVM_C_DYLIB AND MSVC)
|
|||||||
set(GEN_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/gen-msvc-exports.py)
|
set(GEN_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/gen-msvc-exports.py)
|
||||||
|
|
||||||
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports)
|
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports)
|
||||||
|
if(NOT LLVM_NM)
|
||||||
if(CMAKE_CROSSCOMPILING)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
build_native_tool(llvm-nm llvm_nm)
|
build_native_tool(llvm-nm llvm_nm)
|
||||||
set(llvm_nm_target "${llvm_nm}")
|
set(llvm_nm_target "${llvm_nm}")
|
||||||
@ -162,6 +162,10 @@ if(LLVM_BUILD_LLVM_C_DYLIB AND MSVC)
|
|||||||
set(llvm_nm $<TARGET_FILE:llvm-nm>)
|
set(llvm_nm $<TARGET_FILE:llvm-nm>)
|
||||||
set(llvm_nm_target llvm-nm)
|
set(llvm_nm_target llvm-nm)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
set(llvm_nm ${LLVM_NM})
|
||||||
|
set(llvm_nm_target "")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${LLVM_EXPORTED_SYMBOL_FILE}
|
add_custom_command(OUTPUT ${LLVM_EXPORTED_SYMBOL_FILE}
|
||||||
COMMAND "${Python3_EXECUTABLE}" ${GEN_SCRIPT} --libsfile ${LIBSFILE} ${GEN_UNDERSCORE} --nm "${llvm_nm}" -o ${LLVM_EXPORTED_SYMBOL_FILE}
|
COMMAND "${Python3_EXECUTABLE}" ${GEN_SCRIPT} --libsfile ${LIBSFILE} ${GEN_UNDERSCORE} --nm "${llvm_nm}" -o ${LLVM_EXPORTED_SYMBOL_FILE}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user