File tree Expand file tree Collapse file tree 3 files changed +19
-20
lines changed Expand file tree Collapse file tree 3 files changed +19
-20
lines changed Original file line number Diff line number Diff line change @@ -368,14 +368,22 @@ macro(construct_compiler_rt_default_triple)
368
368
"Default triple for which compiler-rt runtimes will be built." )
369
369
endif ()
370
370
371
- if ( " ${ CMAKE_C_COMPILER_ID} " MATCHES "Clang" )
371
+ if ( CMAKE_C_COMPILER_ID MATCHES "Clang" )
372
372
set (option_prefix "" )
373
373
if (CMAKE_C_SIMULATE_ID MATCHES "MSVC" )
374
374
set (option_prefix "/clang:" )
375
375
endif ()
376
- execute_process (COMMAND ${CMAKE_C_COMPILER} ${option_prefix} --target =${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${option_prefix} -print-target -triple
377
- OUTPUT_VARIABLE COMPILER_RT_DEFAULT_TARGET_TRIPLE
378
- OUTPUT_STRIP_TRAILING_WHITESPACE)
376
+ set (print_target_triple ${CMAKE_C_COMPILER} ${option_prefix} --target =${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${option_prefix} -print-target -triple)
377
+ execute_process (COMMAND ${print_target_triple}
378
+ RESULT_VARIABLE result
379
+ OUTPUT_VARIABLE output
380
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
381
+ if (result EQUAL 0)
382
+ set (COMPILER_RT_DEFAULT_TARGET_TRIPLE ${output} )
383
+ else ()
384
+ string (REPLACE ";" " " print_target_triple "${print_target_triple} " )
385
+ message (WARNING "Failed to execute `${print_target_triple} ` to normalize target triple." )
386
+ endif ()
379
387
endif ()
380
388
381
389
string (REPLACE "-" ";" LLVM_TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} )
Original file line number Diff line number Diff line change @@ -28,19 +28,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
28
28
if (NOT LLVM_RUNTIMES_BUILD)
29
29
load_llvm_config()
30
30
endif ()
31
- if (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE )
32
- set (print_target_triple ${CMAKE_CXX_COMPILER} --target =${LLVM_RUNTIME_TRIPLE} -print-target -triple)
33
- execute_process (COMMAND ${print_target_triple}
34
- RESULT_VARIABLE result
35
- OUTPUT_VARIABLE output
36
- OUTPUT_STRIP_TRAILING_WHITESPACE)
37
- if (result EQUAL 0)
38
- set (LLVM_RUNTIME_TRIPLE ${output} )
39
- else ()
40
- string (REPLACE ";" " " print_target_triple "${print_target_triple} " )
41
- message (WARNING "Failed to execute `${print_target_triple} ` to normalize target triple." )
42
- endif ()
43
- endif ()
44
31
construct_compiler_rt_default_triple()
45
32
46
33
include (SetPlatformToolchainTools)
Original file line number Diff line number Diff line change @@ -183,14 +183,18 @@ message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}")
183
183
184
184
set (LLVM_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE} " )
185
185
186
- if (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE )
187
- set (print_target_triple ${CMAKE_CXX_COMPILER} --target =${LLVM_RUNTIME_TRIPLE} -print-target -triple)
186
+ if (CMAKE_C_COMPILER_ID MATCHES "Clang" )
187
+ set (option_prefix "" )
188
+ if (CMAKE_C_SIMULATE_ID MATCHES "MSVC" )
189
+ set (option_prefix "/clang:" )
190
+ endif ()
191
+ set (print_target_triple ${CMAKE_C_COMPILER} ${option_prefix} --target =${LLVM_DEFAULT_TARGET_TRIPLE} ${option_prefix} -print-target -triple)
188
192
execute_process (COMMAND ${print_target_triple}
189
193
RESULT_VARIABLE result
190
194
OUTPUT_VARIABLE output
191
195
OUTPUT_STRIP_TRAILING_WHITESPACE)
192
196
if (result EQUAL 0)
193
- set (LLVM_RUNTIME_TRIPLE ${output} )
197
+ set (LLVM_DEFAULT_TARGET_TRIPLE ${output} )
194
198
else ()
195
199
string (REPLACE ";" " " print_target_triple "${print_target_triple} " )
196
200
message (WARNING "Failed to execute `${print_target_triple} ` to normalize target triple." )
You can’t perform that action at this time.
0 commit comments