mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-26 23:21:11 +00:00
[CMake] Setting the LLVM_TARGET_TRIPLE macro based on the LLVM_DEFAULT_TARGET_TRIPLE
After D137870, LLVM_TARGET_TRIPLE is no longer defined on the runtime path into compiler-rt. This patch creates a common block of code to set LLVM_TARGET_TRIPLE equal to the default for both the llvm- and runtime- paths. Differential Revision: https://reviews.llvm.org/D138864
This commit is contained in:
parent
beb3fa2d2e
commit
2ee308ceea
@ -857,17 +857,8 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE_default}" CACHE STRING
|
||||
"Default target for which LLVM will generate code." )
|
||||
if (TARGET_TRIPLE)
|
||||
message(WARNING "TARGET_TRIPLE is deprecated and will be removed in a future release. "
|
||||
"Please use LLVM_DEFAULT_TARGET_TRIPLE instead.")
|
||||
set(LLVM_TARGET_TRIPLE "${TARGET_TRIPLE}")
|
||||
else()
|
||||
set(LLVM_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
|
||||
endif()
|
||||
message(STATUS "LLVM host triple: ${LLVM_HOST_TRIPLE}")
|
||||
message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}")
|
||||
include(SetTargetTriple)
|
||||
set_llvm_target_triple()
|
||||
|
||||
if(WIN32 OR CYGWIN)
|
||||
if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
|
||||
|
13
llvm/cmake/modules/SetTargetTriple.cmake
Normal file
13
llvm/cmake/modules/SetTargetTriple.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
macro(set_llvm_target_triple)
|
||||
set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE_default}" CACHE STRING
|
||||
"Default target for which LLVM will generate code." )
|
||||
if (TARGET_TRIPLE)
|
||||
message(WARNING "TARGET_TRIPLE is deprecated and will be removed in a future release. "
|
||||
"Please use LLVM_DEFAULT_TARGET_TRIPLE instead.")
|
||||
set(LLVM_TARGET_TRIPLE "${TARGET_TRIPLE}")
|
||||
else()
|
||||
set(LLVM_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
|
||||
endif()
|
||||
message(STATUS "LLVM host triple: ${LLVM_HOST_TRIPLE}")
|
||||
message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}")
|
||||
endmacro()
|
@ -176,6 +176,9 @@ endif()
|
||||
# This can be used to detect whether we're in the runtimes build.
|
||||
set(LLVM_RUNTIMES_BUILD ON)
|
||||
|
||||
include(SetTargetTriple)
|
||||
set_llvm_target_triple()
|
||||
|
||||
foreach(entry ${runtimes})
|
||||
get_filename_component(projName ${entry} NAME)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user