From 11d310bba0f64e26ffeca18c836af6a594e7a3cf Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 23 May 2018 14:49:48 +0200 Subject: [PATCH 1/6] Fix typo falg/flag --- Installation/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index d5173fdf76b..7bbb1ffa92c 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1122,13 +1122,13 @@ because IPE_FOUND is false.") endif() if(CGAL_ENABLE_CHECK_HEADERS) - set(falg "-fsyntax-only") + set(flag "-fsyntax-only") else() - set(falg "-E") + set(flag "-E") endif() if(NOT DEFINED CGAL_CHECK_SYNTAX_ONLY) execute_process(COMMAND - ${CMAKE_CXX_COMPILER} -x c++ ${falg} ${CGAL_MODULES_DIR}/config/support/test_syntaxonly.cpp + ${CMAKE_CXX_COMPILER} -x c++ ${flag} ${CGAL_MODULES_DIR}/config/support/test_syntaxonly.cpp ERROR_QUIET RESULT_VARIABLE ok) if(ok EQUAL 0) @@ -1139,7 +1139,7 @@ because IPE_FOUND is false.") endif(NOT DEFINED CGAL_CHECK_SYNTAX_ONLY) if(NOT CGAL_CHECK_SYNTAX_ONLY) - message(FATAL_ERROR "Your compiler does not seem to support ${falg}. + message(FATAL_ERROR "Your compiler does not seem to support ${flag}. You must disable CGAL_ENABLE_CHECK_HEADERS.") endif() @@ -1277,7 +1277,7 @@ LEDA_FOUND is false.") separate_arguments(CMD UNIX_COMMAND "${CMAKE_CXX_COMPILER} ${compile_options_str} -${include_options_str} -x c++ ${falg} -H \ +${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. From 4ba33e17d3e17b732ee751a202d951c7205558d7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 23 May 2018 14:50:15 +0200 Subject: [PATCH 2/6] Run the compiler a second time without -H in case of errors --- Installation/CMakeLists.txt | 10 ++++++++++ .../modules/run_cmd_redirection_cerr.cmake | 17 +++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 7bbb1ffa92c..62827b3096c 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -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 diff --git a/Installation/cmake/modules/run_cmd_redirection_cerr.cmake b/Installation/cmake/modules/run_cmd_redirection_cerr.cmake index baaa2971452..820847fa6eb 100644 --- a/Installation/cmake/modules/run_cmd_redirection_cerr.cmake +++ b/Installation/cmake/modules/run_cmd_redirection_cerr.cmake @@ -17,15 +17,19 @@ 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) - string(REPLACE ";" " " CMD_STR "${CMD}") - message(SEND_ERROR + 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 ${CMD_STR} > ${CERR} ended with the error code ${error_result}, @@ -34,4 +38,5 @@ ${output} and the following error output: ${err}" ) + endif() endif() From d2bb0559028a759a0386fbab51520a2c9dd26f44 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 23 May 2018 14:51:15 +0200 Subject: [PATCH 3/6] Run `make packages_dependencies` with -k That will make the process continue in case of errors. --- Scripts/developer_scripts/cgal_check_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/developer_scripts/cgal_check_dependencies.sh b/Scripts/developer_scripts/cgal_check_dependencies.sh index d394e40f56d..3de5fa5ad91 100644 --- a/Scripts/developer_scripts/cgal_check_dependencies.sh +++ b/Scripts/developer_scripts/cgal_check_dependencies.sh @@ -29,7 +29,7 @@ do done cmake -DCGAL_HEADER_ONLY=FALSE -DCGAL_ENABLE_CHECK_HEADERS=TRUE -DDOXYGEN_EXECUTABLE="$DOX_PATH" -DCGAL_COPY_DEPENDENCIES=TRUE -DCMAKE_CXX_FLAGS="-std=c++11" .. -make -j$(nproc --all) packages_dependencies +make -j$(nproc --all) -k packages_dependencies echo " Checks finished" for pkg_path in $CGAL_ROOT/* do From e9c80ba3f5100f1d76b2089cabb192658b89104a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 23 May 2018 14:57:16 +0200 Subject: [PATCH 4/6] Introduce an error on purpose, to test Travis --- AABB_tree/include/CGAL/AABB_tree.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index a3b0a928e6d..997743aa3f4 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -44,6 +44,8 @@ namespace CGAL { +error + /// \addtogroup PkgAABB_tree /// @{ From 39c913a090e61cf466a179cecfdd5cc69330664a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 24 May 2018 14:44:48 +0200 Subject: [PATCH 5/6] CERR: create the file before using it --- Installation/cmake/modules/run_cmd_redirection_cerr.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Installation/cmake/modules/run_cmd_redirection_cerr.cmake b/Installation/cmake/modules/run_cmd_redirection_cerr.cmake index 820847fa6eb..40269e5b2c2 100644 --- a/Installation/cmake/modules/run_cmd_redirection_cerr.cmake +++ b/Installation/cmake/modules/run_cmd_redirection_cerr.cmake @@ -15,11 +15,16 @@ if(NOT CERR) "The variable `CERR` should be defined to the output error file!") endif() +# Create the file before using it +file(WRITE ${CERR}) + +# Execute the command ${CMD} with stderr redirected to the file ${CERR} execute_process( COMMAND ${CMD} ERROR_FILE "${CERR}" OUTPUT_VARIABLE output RESULT_VARIABLE error_result) + if(error_result) if(CMD2) file(REMOVE ${CERR}) From 7d628c581a3b0ad2bdc77e3ac061aa5cd9efc629 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 24 May 2018 18:59:15 +0200 Subject: [PATCH 6/6] Revert "Introduce an error on purpose, to test Travis" This reverts commit e9c80ba3f5100f1d76b2089cabb192658b89104a. --- AABB_tree/include/CGAL/AABB_tree.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 997743aa3f4..a3b0a928e6d 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -44,8 +44,6 @@ namespace CGAL { -error - /// \addtogroup PkgAABB_tree /// @{