Skip to content

Commit ed2bfd1

Browse files
authored
[Flang] Add -fintrinsic-modules-path= alias (#149417)
Add the syntax `-fintrinsic-modules-path=<dir>` as an alias to the existing option `-fintrinsic-modules-path <dir>`. gfortran also supports both alternatives. This is particularly useful with CMake which de-duplicates command-line options. For instance, `-fintrinsic-modules-path /path/A -fintrinsic-modules-path /path/B` is de-duplicated to `-fintrinsic-modules-path /path/A /path/B` since it conisiders the second `-fintrinsic-modules-path` "redundant". This can be avoided using the syntax `-fintrinsic-modules-path=/path/A -fintrinsic-modules-path=/path/B`.
1 parent e39ee62 commit ed2bfd1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7130,6 +7130,8 @@ def fintrinsic_modules_path : Separate<["-"], "fintrinsic-modules-path">, Group
71307130
HelpText<"Specify where to find the compiled intrinsic modules">,
71317131
DocBrief<[{This option specifies the location of pre-compiled intrinsic modules,
71327132
if they are not in the default location expected by the compiler.}]>;
7133+
def fintrinsic_modules_path_EQ : Joined<["-"], "fintrinsic-modules-path=">,
7134+
Group<f_Group>, Alias<fintrinsic_modules_path>;
71337135

71347136
defm backslash : OptInFC1FFlag<"backslash", "Specify that backslash in string introduces an escape character">;
71357137
defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of .NEQV.">;

flang/test/Driver/intrinsic-module-path.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
!-----------------------------------------
99
! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT
1010
! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN
11+
! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path=%S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN
1112

1213
! WITHOUT-NOT: 'ieee_arithmetic.mod' was not found
1314
! WITHOUT-NOT: 'iso_fortran_env.mod' was not found

0 commit comments

Comments
 (0)