File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,17 @@ set (CXX_FLAGS
20
20
21
21
option (DETECT_TARGET_TRIPLE "Automatically detect the target triple for clang" ON )
22
22
if (DETECT_TARGET_TRIPLE )
23
- execute_process (
24
- COMMAND bash -c "llvm-config --host-target | tr -d '\n '"
25
- OUTPUT_VARIABLE LLVM_TARGET_TRIPLE
26
- )
27
- list (APPEND CXX_FLAGS "-target ${LLVM_TARGET_TRIPLE} " )
23
+ find_program (LLVM_CONFIG_BIN llvm-config )
24
+ if (NOT LLVM_CONFIG_BIN )
25
+ message (FATAL_ERROR "llvm-config not found!" )
26
+ endif ()
27
+ message (STATUS "Using llvm-config: " ${LLVM_CONFIG_BIN} )
28
+
29
+ execute_process (
30
+ COMMAND bash -c "${LLVM_CONFIG_BIN} --host-target | tr -d '\n '"
31
+ OUTPUT_VARIABLE LLVM_TARGET_TRIPLE
32
+ )
33
+ list (APPEND CXX_FLAGS "-target ${LLVM_TARGET_TRIPLE} " )
28
34
endif ()
29
35
30
36
list (JOIN CXX_FLAGS " " CXX_FLAGS_STR )
You can’t perform that action at this time.
0 commit comments