[cmake] Print out errors from failed stack steps
Per [cmake docs](https://cmake.org/cmake/help/v3.0/command/execute_process.html), if you set both `OUTPUT_VARIABLE` and `ERROR_VARIABLE` to the same var, it will contain both streams' lines, merged in the order they were printed.
This commit is contained in:
Родитель
f32cf13c2b
Коммит
a9167d7ccc
|
@ -14,11 +14,11 @@ execute_process (
|
||||||
COMMAND ${STACK_EXECUTABLE} ${BOND_STACK_OPTIONS} setup
|
COMMAND ${STACK_EXECUTABLE} ${BOND_STACK_OPTIONS} setup
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
RESULT_VARIABLE error
|
RESULT_VARIABLE error
|
||||||
OUTPUT_QUIET
|
OUTPUT_VARIABLE setup_output
|
||||||
ERROR_QUIET)
|
ERROR_VARIABLE setup_output)
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
message (FATAL_ERROR)
|
message (FATAL_ERROR ${setup_output})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (buildGhcOptions "-O2")
|
set (buildGhcOptions "-O2")
|
||||||
|
@ -29,7 +29,7 @@ execute_process (
|
||||||
RESULT_VARIABLE error)
|
RESULT_VARIABLE error)
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
message (FATAL_ERROR)
|
message (FATAL_ERROR "build failed - scroll up for its output")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Copy results to builddir
|
# Copy results to builddir
|
||||||
|
@ -37,10 +37,11 @@ execute_process (
|
||||||
COMMAND ${STACK_EXECUTABLE} ${BOND_STACK_OPTIONS} path --dist-dir
|
COMMAND ${STACK_EXECUTABLE} ${BOND_STACK_OPTIONS} path --dist-dir
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE dist_dir
|
OUTPUT_VARIABLE dist_dir
|
||||||
RESULT_VARIABLE error)
|
RESULT_VARIABLE error
|
||||||
|
ERROR_VARIABLE path_errors)
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
message (FATAL_ERROR)
|
message (FATAL_ERROR ${path_errors})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
string (STRIP ${dist_dir} dist_dir)
|
string (STRIP ${dist_dir} dist_dir)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче