mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fail build when execute_process fails
This commit is contained in:
parent
f015a6154a
commit
aacaf7455a
2 changed files with 19 additions and 1 deletions
|
@ -137,8 +137,17 @@ execute_process(
|
|||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../extern/llvm_linux_13_0_1/bin/llvm-config --system-libs --link-static
|
||||
OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE EXEC_RESULT
|
||||
)
|
||||
|
||||
if (EXEC_RESULT AND NOT EXEC_RESULT EQUAL 0)
|
||||
if (EXEC_RESULT MATCHES "^[0-9]+$")
|
||||
message(FATAL_ERROR "llvm-config exited with code ${EXEC_RESULT}.")
|
||||
else()
|
||||
message(FATAL_ERROR "llvm-config couldn't be executed: ${EXEC_RESULT}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (${APPLE})
|
||||
set(TARGET_LIBS_OS "")
|
||||
else()
|
||||
|
|
|
@ -195,9 +195,18 @@ add_library(${PROJECT_NAME} SHARED
|
|||
execute_process(
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../extern/llvm_linux_13_0_1/bin/llvm-config --system-libs --link-static
|
||||
OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE EXEC_RESULT
|
||||
)
|
||||
|
||||
if (EXEC_RESULT AND NOT EXEC_RESULT EQUAL 0)
|
||||
if (EXEC_RESULT MATCHES "^[0-9]+$")
|
||||
message(FATAL_ERROR "llvm-config exited with code ${EXEC_RESULT}.")
|
||||
else()
|
||||
message(FATAL_ERROR "llvm-config couldn't be executed: ${EXEC_RESULT}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(TARGET_LIBS_OS "${LLVM_SYSTEM_LIBS}")
|
||||
|
||||
if (HAVE_BACKTRACE_HEADERS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue