]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve detection of ld.gold 5873/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 7 Feb 2018 00:32:26 +0000 (01:32 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 7 Feb 2018 00:50:35 +0000 (01:50 +0100)
cmake/checks/check_01_compiler_features.cmake

index 479d274b3b920b77a450aaa48fbcca7451c98e96..9341c1afcc1612b4819d4e8905dee6e56c45daf5 100644 (file)
@@ -408,11 +408,21 @@ RESET_CMAKE_REQUIRED()
 # Use the 'gold' linker if possible, given that it's substantially faster.
 #
 # We have to try to link a full executable with -fuse-ld=gold to check
-# whether "ld.gold" is actually available. gcc has the bad habit of
-# accepting the flag without emitting an error.
+# whether "ld.gold" is actually available.
 #
-# Wolfgang Bangerth, Matthias Maier, 2015
+# Clang always reports "argument unused during compilation"
+# if "-fuse-ld=" is used, but fails at link time for an unsupported linker.
 #
+# ICC also emits a warning but passes for unsupported linkers
+# unless we turn diagnostic warnings into errors.
+#
+# Wolfgang Bangerth, Matthias Maier, Daniel Arndt, 2015, 2018
+#
+IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  PUSH_CMAKE_REQUIRED("-Wno-unused-command-line-argument")
+ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+  PUSH_CMAKE_REQUIRED("-diag-error warn")
+ENDIF()
 PUSH_CMAKE_REQUIRED("-Werror")
 PUSH_CMAKE_REQUIRED("-fuse-ld=gold")
 CHECK_CXX_SOURCE_COMPILES(

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.