Skip to content

Commit 1574668

Browse files
committed
clang: Fix tests that use /DEF for MSVC LINK.exe
1 parent a269514 commit 1574668

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mesonbuild/compilers/mixins/clang.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ def openmp_flags(self) -> T.List[str]:
111111
# Shouldn't work, but it'll be checked explicitly in the OpenMP dependency.
112112
return []
113113

114+
def gen_vs_module_defs_args(self, defsfile: str) -> T.List[str]:
115+
if isinstance(self.linker, (MSVCDynamicLinker)):
116+
# With MSVC, DLLs only export symbols that are explicitly exported,
117+
# so if a module defs file is specified, we use that to export symbols
118+
return ['-Wl,/DEF:' + defsfile]
119+
return super().gen_vs_module_defs_args(defsfile)
120+
114121
@classmethod
115122
def use_linker_args(cls, linker: str, version: str) -> T.List[str]:
116123
# Clang additionally can use a linker specified as a path, which GCC

0 commit comments

Comments
 (0)