summaryrefslogtreecommitdiff
path: root/share/cmake-3.22/Modules/Compiler/XL-Fortran/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'share/cmake-3.22/Modules/Compiler/XL-Fortran/cpp')
-rwxr-xr-xshare/cmake-3.22/Modules/Compiler/XL-Fortran/cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/share/cmake-3.22/Modules/Compiler/XL-Fortran/cpp b/share/cmake-3.22/Modules/Compiler/XL-Fortran/cpp
new file mode 100755
index 0000000..1fd62c2
--- /dev/null
+++ b/share/cmake-3.22/Modules/Compiler/XL-Fortran/cpp
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+# Source file.
+src="$(printf %q "$1")"
+shift
+
+# Output file the compiler expects.
+out="$(printf %q "$1")"
+shift
+
+# Create the file the compiler expects. It will check syntax.
+>"$out"
+
+cpp='cpp'
+opts=''
+while test "$#" != 0; do
+ case "$1" in
+ # Extract the option for the path to cpp.
+ --cpp) shift; cpp="$(printf %q "$1")" ;;
+ # Extract the option for our own output file.
+ --out) shift; out="$(printf %q "$1")" ;;
+ # Collect the rest of the command line.
+ *) opts="$opts $(printf %q "$1")" ;;
+ esac
+ shift
+done
+
+# Execute the real preprocessor tool.
+eval "exec $cpp $src $out $opts"