lld-link support .def

add .def support for windows, clang.exe lld-link.exe
pull/13675/head
shihchao-work 6 months ago committed by shihchao-work
parent 7813354460
commit 262eb9b873
  1. 3
      mesonbuild/compilers/mixins/clang.py

@ -8,6 +8,7 @@ from __future__ import annotations
import os import os
import shutil import shutil
import typing as T import typing as T
import re
from ... import mesonlib from ... import mesonlib
from ...linkers.linkers import AppleDynamicLinker, ClangClDynamicLinker, LLVMDynamicLinker, GnuGoldDynamicLinker, \ from ...linkers.linkers import AppleDynamicLinker, ClangClDynamicLinker, LLVMDynamicLinker, GnuGoldDynamicLinker, \
@ -139,6 +140,8 @@ class ClangCompiler(GnuLikeCompiler):
# With MSVC, DLLs only export symbols that are explicitly exported, # With MSVC, DLLs only export symbols that are explicitly exported,
# so if a module defs file is specified, we use that to export symbols # so if a module defs file is specified, we use that to export symbols
return ['-Wl,/DEF:' + defsfile] return ['-Wl,/DEF:' + defsfile]
if isinstance(self.linker, ClangClDynamicLinker):
return ['-Wl,/DEF:' + re.sub(R'(?<!\\)\\(?!\\)', R'\\\\', defsfile.replace('/', '\\'))]
return super().gen_vs_module_defs_args(defsfile) return super().gen_vs_module_defs_args(defsfile)
@classmethod @classmethod

Loading…
Cancel
Save