]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid tabs and don't test for alternative linker with MSVC
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 13 Mar 2019 08:56:12 +0000 (09:56 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 13 Mar 2019 09:26:59 +0000 (10:26 +0100)
cmake/checks/check_01_cxx_features.cmake
cmake/checks/check_02_compiler_features.cmake
cmake/configure/configure_2_boost.cmake

index 1f71219af41f4700bdf87a1831f3f3951da9d3b0..2f5cf61e7efc9c815d98b7891028bb4f6869542b 100644 (file)
@@ -104,12 +104,12 @@ MACRO(_check_cxx_flag _suffix)
       IF(DEAL_II_HAVE_FLAG_stdcxx${_suffix})
         SET(DEAL_II_CXX_VERSION_FLAG "/std:c++${_suffix}")
       ENDIF()
-       ELSE()
+    ELSE()
       CHECK_CXX_COMPILER_FLAG("-std=c++${_suffix}" DEAL_II_HAVE_FLAG_stdcxx${_suffix})
       IF(DEAL_II_HAVE_FLAG_stdcxx${_suffix})
         SET(DEAL_II_CXX_VERSION_FLAG "-std=c++${_suffix}")
       ENDIF()
-       ENDIF()
+    ENDIF()
   ENDIF()
 ENDMACRO()
 
@@ -542,7 +542,7 @@ CHECK_CXX_SOURCE_COMPILES(
   }
   "
   DEAL_II_COMPILER_DEFAULTS_TO_CXX11_OR_NEWER)
-  RESET_CMAKE_REQUIRED()
+RESET_CMAKE_REQUIRED()
 
 IF(_user_provided_cxx_version_flag OR
     NOT DEAL_II_COMPILER_DEFAULTS_TO_CXX11_OR_NEWER OR
index d7d7c832189307ce8607762d8a2d1c202ac34322..e844e7d904dcbc464f4c8d198e93b50946dcf85b 100644 (file)
@@ -442,45 +442,38 @@ RESET_CMAKE_REQUIRED()
 #
 # Wolfgang Bangerth, Matthias Maier, Daniel Arndt, 2015, 2018
 #
-IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument")
-ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
-  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn")
-ENDIF()
-IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
-  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX")
-ELSE()
+IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+  IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument")
+  ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn")
+  ENDIF()
   ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror")
-ENDIF()
-ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=lld")
-CHECK_CXX_SOURCE_COMPILES(
-  "
-  int main() { return 0; }
-  "
-  DEAL_II_COMPILER_HAS_FUSE_LD_LLD)
-RESET_CMAKE_REQUIRED()
+  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=lld")
+  CHECK_CXX_SOURCE_COMPILES(
+    "
+    int main() { return 0; }
+    "
+    DEAL_II_COMPILER_HAS_FUSE_LD_LLD)
+  RESET_CMAKE_REQUIRED()
 
-IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument")
-ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
-  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn")
-ENDIF()
-IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
-  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX")
-ELSE()
+  IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument")
+  ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn")
+  ENDIF()
   ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror")
-ENDIF()
-ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=gold")
-CHECK_CXX_SOURCE_COMPILES(
-  "
-  int main() { return 0; }
-  "
-  DEAL_II_COMPILER_HAS_FUSE_LD_GOLD)
-RESET_CMAKE_REQUIRED()
+  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=gold")
+  CHECK_CXX_SOURCE_COMPILES(
+    "
+    int main() { return 0; }
+    "
+    DEAL_II_COMPILER_HAS_FUSE_LD_GOLD)
+  RESET_CMAKE_REQUIRED()
 
-IF(DEAL_II_COMPILER_HAS_FUSE_LD_LLD)
-  ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=lld")
-ELSEIF(DEAL_II_COMPILER_HAS_FUSE_LD_GOLD)
-  ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=gold")
+  IF(DEAL_II_COMPILER_HAS_FUSE_LD_LLD)
+    ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=lld")
+  ELSEIF(DEAL_II_COMPILER_HAS_FUSE_LD_GOLD)
+    ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=gold")
+  ENDIF()
 ENDIF()
-
index 1b5988fc8f361be4ecb54c5dd32d398b00054d41..1637b16695c8536ab4116a962102e2df04bc024e 100644 (file)
@@ -59,7 +59,7 @@ MACRO(FEATURE_BOOST_CONFIGURE_COMMON)
   # circumvent the issue. Hence, we just check ourselves.
   ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
   IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
-    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX")
+    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX /EHsc")
   ELSE()
     ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror")
   ENDIF()

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.