compilers/c: Fix allow undefined link arg for PE/COFF

For PE/COFF it is not possible to allow undefined symbols, so do not
try to use the option to do so.

While gcc ld silently ignores it, this is not the case for the llvm
linker.

Fix #4415
pull/4349/head
Marvin Scholz 6 years ago committed by Jussi Pakkanen
parent fc3e2f5ad0
commit 2256e6314b
  1. 3
      mesonbuild/compilers/c.py

@ -164,6 +164,9 @@ class CCompiler(Compiler):
if self.compiler_type.is_osx_compiler:
# Apple ld
return ['-Wl,-undefined,dynamic_lookup']
elif self.compiler_type.is_windows_compiler:
# For PE/COFF this is impossible
return []
else:
# GNU ld and LLVM lld
return ['-Wl,--allow-shlib-undefined']

Loading…
Cancel
Save