Skip to content

Commit

Permalink
detect windows linkers for flang in detect_fortran_compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Sep 29, 2023
1 parent 32be9bd commit bd5e13e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions mesonbuild/compilers/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,20 @@ def detect_fortran_compiler(env: 'Environment', for_machine: MachineChoice) -> C

if 'flang' in out or 'clang' in out:
cls = fortran.FlangFortranCompiler
linker = guess_nix_linker(env,
compiler, cls, version, for_machine)
if 'windows' in out or env.machines[for_machine].is_windows():
# If we're in a MINGW context this actually will use a gnu
# style ld, but for flang on "real" windows we'll use
# either link.exe or lld-link.exe
try:
linker = guess_win_linker(
env, compiler, cls, version,
for_machine, invoked_directly=False
)
except MesonException:
pass
if linker is None:
linker = guess_nix_linker(env, compiler, cls,
version, for_machine)
return cls(
compiler, version, for_machine, is_cross, info,
exe_wrap, full_version=full_version, linker=linker)
Expand Down

0 comments on commit bd5e13e

Please sign in to comment.