From: Matthias Maier Date: Sat, 3 Dec 2022 04:04:05 +0000 (-0600) Subject: CMake: remove DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS configure option X-Git-Tag: v9.5.0-rc1~758^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61ee6e26b562f181c2b3f9a6232e6a438640b743;p=dealii.git CMake: remove DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS configure option --- diff --git a/cmake/setup_cached_variables.cmake b/cmake/setup_cached_variables.cmake index fd690594b4..91a58bd8b6 100644 --- a/cmake/setup_cached_variables.cmake +++ b/cmake/setup_cached_variables.cmake @@ -32,7 +32,6 @@ # # CMAKE_BUILD_TYPE # DEAL_II_ALLOW_PLATFORM_INTROSPECTION -# DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS # DEAL_II_SETUP_COVERAGE # DEAL_II_UNITY_BUILD # DEAL_II_EARLY_DEPRECATIONS @@ -153,12 +152,6 @@ option(DEAL_II_ALLOW_PLATFORM_INTROSPECTION ) mark_as_advanced(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) -option(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS - "Configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target." - ON - ) -mark_as_advanced(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) - option(DEAL_II_SETUP_COVERAGE "Setup debug compiler flags to provide additional test coverage information. Currently only gprof is supported." OFF diff --git a/cmake/setup_compiler_flags.cmake b/cmake/setup_compiler_flags.cmake index 4f9a8e762b..04c7ba9836 100644 --- a/cmake/setup_compiler_flags.cmake +++ b/cmake/setup_compiler_flags.cmake @@ -97,48 +97,28 @@ endforeach() # # ######################################################################## -if(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) - # - # *Hooray* We are allowed to set compiler flags :-] - # - +if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR + CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) # # General setup for GCC and compilers sufficiently close to GCC: # - if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR - CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) - verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_gnu.cmake) - set(DEAL_II_KNOWN_COMPILER TRUE) - endif() + verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_gnu.cmake) +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") # # Setup for ICC compiler (version >= 10): # - if(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_intel.cmake) - set(DEAL_II_KNOWN_COMPILER TRUE) - endif() + verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_intel.cmake) +elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") # # Setup for MSVC compiler (version >= 2012): # - if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_msvc.cmake) - set(DEAL_II_KNOWN_COMPILER TRUE) - endif() - - if(NOT DEAL_II_KNOWN_COMPILER) - message(FATAL_ERROR "\n" - "Unknown compiler!\n" - "If you're serious about it, set DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS=OFF " - "and set the relevant compiler options by hand.\n\n" - ) - endif() + verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_msvc.cmake) else() - - message(STATUS - "Skipped setup of default compiler flags " - "(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS=OFF)" + message(WARNING "\nUnknown compiler!\n" + "Please populate the CMake variables DEAL_II_CXX_FLAGS(|DEBUG|RELEASE) " + "and DEAL_II_LINKER_FLAGS(|DEBUG|RELEASE) as needed." ) endif() diff --git a/cmake/setup_write_config.cmake b/cmake/setup_write_config.cmake index 4a639402b2..379f051279 100644 --- a/cmake/setup_write_config.cmake +++ b/cmake/setup_write_config.cmake @@ -162,9 +162,6 @@ endif() _detailed("#\n") -if(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) - _both("# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n") -endif() _both("# Configured Features (") if(DEFINED DEAL_II_ALLOW_BUNDLED) _both("DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, ") diff --git a/doc/developers/porting.html b/doc/developers/porting.html index 1df58d12b8..bb71a6a570 100644 --- a/doc/developers/porting.html +++ b/doc/developers/porting.html @@ -35,8 +35,7 @@ sets up reasonable default compiler flags.