]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: remove DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS configure option
authorMatthias Maier <tamiko@43-1.org>
Sat, 3 Dec 2022 04:04:05 +0000 (22:04 -0600)
committerMatthias Maier <tamiko@43-1.org>
Sat, 3 Dec 2022 04:34:01 +0000 (22:34 -0600)
cmake/setup_cached_variables.cmake
cmake/setup_compiler_flags.cmake
cmake/setup_write_config.cmake
doc/developers/porting.html
doc/users/cmake_dealii.html
doc/users/config.sample

index fd690594b470942b1ac9ed3b18bbca00abb72fe6..91a58bd8b6f7d1026d97783709bbcb73b1166cff 100644 (file)
@@ -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
index 4f9a8e762b7135ff55bedf4f14c82a026e1d3ce8..04c7ba9836b417e790d1983b07ac4d0851883e3d 100644 (file)
@@ -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()
index 4a639402b2292c86a293693ae3a70272a4cbf3c5..379f051279cd30882d40e3571edb7af76d4a2dd1 100644 (file)
@@ -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}, ")
index 1df58d12b83ac043b9f895e8ebc11a15e103dc18..bb71a6a570ddee0000ecb30aeec16b78ade30032 100644 (file)
@@ -35,8 +35,7 @@
       sets up reasonable default compiler flags.
       <ul>
         <li>
-          To start porting to an unknown compiler, specify
-          <code>-DDEAL_II_SETUP_DEFAULT_COMPILER_FLAGS=OFF</code> and set all
+          To start porting to an unknown compiler, specify all
           necessary compiler flags by hand via
 <pre>
 DEAL_II_CXX_FLAGS         - used during all builds
index ee0cf813f9a48f969adddca84c6e6532ff8048cb..c4120ba69161e9e411f6ce149f0cd8d4cf021d96 100644 (file)
@@ -836,9 +836,9 @@ cmake -DCMAKE_C_COMPILER=my_c_compiler -DCMAKE_CXX_COMPILER=my_cxx_compiler -DCM
       target. There are two options to override this behaviour:
 
       <ol>
-       <li>
-         Override the default configuration by setting the following
-         cached variables:
+        <li>
+          Override the default configuration by setting the following
+          cached variables:
 <pre class="cmake">
 DEAL_II_CXX_FLAGS         - used during all builds
 DEAL_II_CXX_FLAGS_DEBUG   - additional flags for the debug library
@@ -849,11 +849,11 @@ DEAL_II_LINKER_FLAGS_DEBUG   - additional flags for the debug library
 DEAL_II_LINKER_FLAGS_RELEASE - additional flags for the release library
 </pre>
 
-         The content of the cached variables will be preserved
-         and added <i>to the end</i> of the default compiler flags,
-         hence providing the possibility for overriding a flag. E.g.:
-         <code>-Wsign-compare</code>, set by the build system, can be
-         overwritten by specifying:
+          The content of the cached variables will be preserved
+          and added <i>to the end</i> of the default compiler flags,
+          hence providing the possibility for overriding a flag. E.g.:
+          <code>-Wsign-compare</code>, set by the build system, can be
+          overwritten by specifying:
 <pre class="cmake">
 cmake -DDEAL_II_CXX_FLAGS="-Wno-sign-compare" &lt;...&gt;
 </pre>
@@ -864,12 +864,6 @@ cmake -DDEAL_II_CXX_FLAGS="-Wno-sign-compare" &lt;...&gt;
           variables will also be appended after the default compiler flags
           (but before the corresponding cached variables).
 
-       <li>
-         Disable the configuration completely by adding the flag
-         <code>-D DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS=OFF</code>.
-         Beware of the fact that certain features
-         may still pull in necessary compiler flags.
-
         <li>
           You can setup additional debug compiler flags to provide test
           coverage information by adding the flag
index 05dc55ecbf9c517762e32e4474e3e47d2f3bc99e..e01d24f8d5df4a287d7e947b731ceb28d97a12ca 100644 (file)
@@ -48,7 +48,6 @@
 # set(DEAL_II_DEFINITIONS_RELEASE "" CACHE STRING "")
 #
 # set(DEAL_II_ALLOW_PLATFORM_INTROSPECTION ON CACHE BOOL "")
-# set(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS ON CACHE BOOL "")
 # set(DEAL_II_SETUP_COVERAGE OFF CACHE BOOL "")
 # set(DEAL_II_UNITY_BUILD OFF CACHE BOOL "")
 # set(DEAL_II_EARLY_DEPRECATIONS OFF CACHE BOOL "")

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.