mirror of https://github.com/CGAL/cgal
Run the compiler a second time without -H in case of errors
This commit is contained in:
parent
11d310bba0
commit
4ba33e17d3
|
|
@ -1278,6 +1278,15 @@ LEDA_FOUND is false.")
|
|||
UNIX_COMMAND
|
||||
"${CMAKE_CXX_COMPILER} ${compile_options_str}
|
||||
${include_options_str} -x c++ ${flag} -H \
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
|
||||
# The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it
|
||||
# depends on RS.
|
||||
)
|
||||
# CMD2 is CMD without the -H option
|
||||
separate_arguments(CMD2
|
||||
UNIX_COMMAND
|
||||
"${CMAKE_CXX_COMPILER} ${compile_options_str}
|
||||
${include_options_str} -x c++ ${flag} \
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
|
||||
# The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it
|
||||
# depends on RS.
|
||||
|
|
@ -1288,6 +1297,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
|
|||
COMMAND ${CMAKE_COMMAND}
|
||||
-DCERR:STRING=${chk_header_name}
|
||||
"-DCMD:STRING=${CMD}"
|
||||
"-DCMD2:STRING=${CMD2}"
|
||||
-P "${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake"
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}
|
||||
DEPENDS ${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake
|
||||
|
|
|
|||
|
|
@ -17,13 +17,17 @@ endif()
|
|||
|
||||
execute_process(
|
||||
COMMAND ${CMD}
|
||||
ERROR_VARIABLE err
|
||||
ERROR_FILE "${CERR}"
|
||||
OUTPUT_VARIABLE output
|
||||
RESULT_VARIABLE error_result)
|
||||
|
||||
file(WRITE ${CERR} "${err}")
|
||||
|
||||
if(error_result)
|
||||
if(CMD2)
|
||||
file(REMOVE ${CERR})
|
||||
execute_process(COMMAND ${CMD2})
|
||||
message(SEND_ERROR)
|
||||
else()
|
||||
file(READ ${CERR} err)
|
||||
file(REMOVE ${CERR})
|
||||
string(REPLACE ";" " " CMD_STR "${CMD}")
|
||||
message(SEND_ERROR
|
||||
"The command
|
||||
|
|
@ -35,3 +39,4 @@ and the following error output:
|
|||
${err}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in New Issue