Skip to content

Commit

Permalink
blabla idc about commit messages. tell me what you like it to say and…
Browse files Browse the repository at this point in the history
… ill push that after codes been approved.
  • Loading branch information
gfudies committed Jan 22, 2025
1 parent 0b9baf5 commit f960163
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 1 addition & 4 deletions mesonbuild/compilers/c.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,7 @@ def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoic
def get_options(self) -> 'MutableKeyedOptionDictType':
opts = super().get_options()
key = self.form_compileropt_key('std')
# To shut up mypy.
if isinstance(opts, dict):
raise RuntimeError('This is a transitory issue that should not happen. Please report with full backtrace.')
std_opt = opts.get_value_object(key)
std_opt = opts.get(key)
assert isinstance(std_opt, options.UserStdOption), 'for mypy'
std_opt.set_versions(['c89', 'c99', 'c11'])
return opts
Expand Down
10 changes: 7 additions & 3 deletions mesonbuild/compilers/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker
for linker in trials:
linker_name = os.path.basename(linker[0])

if any(os.path.basename(x) in {'lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe', 'xilib', 'xilib.exe'} for x in linker):
if os.getenv('FORCE_MSVC_ARFLAGS') or any(os.path.basename(x) in {'lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe', 'xilib', 'xilib.exe'} for x in linker):
arg = '/?'
elif linker_name in {'ar2000', 'ar2000.exe', 'ar430', 'ar430.exe', 'armar', 'armar.exe', 'ar6x', 'ar6x.exe'}:
arg = '?'
Expand Down Expand Up @@ -483,7 +483,9 @@ def sanitize(p: T.Optional[str]) -> T.Optional[str]:
target = 'x86' if 'IA-32' in err else 'x86_64'
cls = c.IntelClCCompiler if lang == 'c' else cpp.IntelClCPPCompiler
env.coredata.add_lang_args(cls.language, cls, for_machine, env)
linker = linkers.XilinkDynamicLinker(for_machine, [], version=version)
linker_exe = env.lookup_binary_entry(for_machine, 'c_ld')
linker_exelist = [linker_exe] if linker_exe else None
linker = linkers.XilinkDynamicLinker(for_machine, [], version=version, exelist=linker_exelist)
return cls(
compiler, version, for_machine, is_cross, info, target,
linker=linker)
Expand All @@ -492,7 +494,9 @@ def sanitize(p: T.Optional[str]) -> T.Optional[str]:
target = 'x86' if 'IA-32' in err else 'x86_64'
cls = c.IntelLLVMClCCompiler if lang == 'c' else cpp.IntelLLVMClCPPCompiler
env.coredata.add_lang_args(cls.language, cls, for_machine, env)
linker = linkers.XilinkDynamicLinker(for_machine, [], version=version)
linker_exe = env.lookup_binary_entry(for_machine, 'c_ld')
linker_exelist = [linker_exe] if linker_exe else None
linker = linkers.XilinkDynamicLinker(for_machine, [], version=version, exelist=linker_exelist)
return cls(
compiler, version, for_machine, is_cross, info, target,
linker=linker)
Expand Down
3 changes: 2 additions & 1 deletion mesonbuild/linkers/linkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,8 @@ def __init__(self, for_machine: mesonlib.MachineChoice, always_args: T.List[str]
prefix: T.Union[str, T.List[str]] = '',
machine: str = 'x86', version: str = 'unknown version',
direct: bool = True):
super().__init__(['xilink.exe'], for_machine, '', always_args, version=version)
super().__init__(exelist or ['xilink.exe'], for_machine,
prefix, always_args, machine=machine, version=version, direct=direct)

def get_win_subsystem_args(self, value: str) -> T.List[str]:
return self._apply_prefix([f'/SUBSYSTEM:{value.upper()}'])
Expand Down

0 comments on commit f960163

Please sign in to comment.