]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: also escape linker flags of the form -Wl,-rpath -Wl,/path/ 15257/head
authorMatthias Maier <tamiko@43-1.org>
Tue, 23 May 2023 13:26:11 +0000 (08:26 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 23 May 2023 13:26:11 +0000 (08:26 -0500)
cmake/macros/macro_shell_escape_option_groups.cmake

index 5c04853cffc8f4503d7352bdd588af370f6f761b..78dca443c07e2f6f252d5689be88ae1d6d8c1486 100644 (file)
@@ -50,4 +50,14 @@ macro(shell_escape_option_groups _variable)
     "SHELL:(-Xcudafe [^;]+|-Xlinker [^;]+);SHELL:(-Xcudafe [^;]+|-Xlinker [^;]+)"
     "SHELL:\\1 \\2" ${_variable} "${${_variable}}"
     )
+
+  #
+  # In addition try to merge options of the form "-Wl,-flag -Wl,/path". We
+  # do this by detecting all occurences of a flag ("-Wl,-[-]flag") followed
+  # by an option that doesn't start with a dash ("-Wl,[option]"):
+  #
+  string(REGEX REPLACE
+    "(-Wl,[-]+[^;]*);(-Wl,[^-][^;]+)"
+    "SHELL:\\1 \\2" ${_variable} "${${_variable}}"
+    )
 endmacro()

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.