From de403e8cc44e5036e9dacbcab087f8d0bb5e729b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20M=C3=B6ller?= Date: Wed, 5 Aug 2015 14:17:25 +0200 Subject: [PATCH] Always run the config tests The code tried to prevent running the config tests to often by caching their values and only rerunning them when the CMAKE_CXX_FLAGS change. While this is smart it only buys us a few seconds and is not actually correct. One of those bugs could be triggered through linker flags or debug flags as well and just checking CMAKE_CXX_FLAGS is far from enough. To be on the safe side we accept the extra configuration-time (which is usually also minimized by using compiler caches). This also removes a warning caused by CMake policy CMP0054. --- Installation/CMakeLists.txt | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 8376cea1e99..0d6e2dbe8c6 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -669,25 +669,18 @@ file( WRITE ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "//\n// compiler_ cache_get(CONFIG_CXX_FLAGS) foreach(config_test_cpp ${all_config_tests}) - - # Test's name is .cpp's base name - get_filename_component(config_test_name ${config_test_cpp} NAME_WE) - - # Compile and run ${config_test_cpp}. Exit code is stored in ${config_test_name}. - if( RUNNING_CGAL_AUTO_TEST OR "${config_test_name}" MATCHES "^${config_test_name}$" OR NOT ${CONFIG_CXX_FLAGS} STREQUAL ${CMAKE_CXX_FLAGS}) + # Test's name is .cpp's base name + get_filename_component(config_test_name ${config_test_cpp} NAME_WE) - CHECK_CXX_FILE_RUNS(${config_test_cpp} ${config_test_name} ${config_test_name}) + # Compile and run ${config_test_cpp}. Exit code is stored in ${config_test_name}. + CHECK_CXX_FILE_RUNS(${config_test_cpp} ${config_test_name} ${config_test_name}) + if(${config_test_name}) + set(${config_test_name} 0) + else() + set(${config_test_name} 1) + endif() - if ( ${config_test_name} ) - cache_set ( ${config_test_name} 0 ) - else() - cache_set ( ${config_test_name} 1 ) - endif() - - endif() - - add_config_flag( ${config_test_name} ${config_test_name} ) - + add_config_flag(${config_test_name} ${config_test_name}) endforeach() cache_set(CONFIG_CXX_FLAGS ${CMAKE_CXX_FLAGS})