mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-22 03:51:33 +00:00
aedi: update flags environment variable via one call
This commit is contained in:
parent
e8b3338d90
commit
fac8e1d288
2 changed files with 9 additions and 19 deletions
|
@ -211,16 +211,14 @@ class BuildState:
|
|||
def has_source_file(self, path: typing.Union[str, Path]):
|
||||
return (self.source / path).exists()
|
||||
|
||||
def update_environment(self, name: str, value: str):
|
||||
env = self.environment
|
||||
env[name] = env[name] + ' ' + value if name in env else value
|
||||
|
||||
def set_sdk(self, var_name: str):
|
||||
def update_flags_environment_variable(self, name: str, value: str):
|
||||
sdk_path = self.sdk_path()
|
||||
if sdk_path:
|
||||
self.update_environment(var_name, f'-isysroot {sdk_path}')
|
||||
value += f' -isysroot {sdk_path}'
|
||||
|
||||
def set_os_version(self, var_name: str):
|
||||
os_version = self.os_version()
|
||||
if os_version:
|
||||
self.update_environment(var_name, f'-mmacosx-version-min={os_version}')
|
||||
value += f' -mmacosx-version-min={os_version}'
|
||||
|
||||
env = self.environment
|
||||
env[name] = env[name] + ' ' + value if name in env else value
|
||||
|
|
|
@ -114,18 +114,10 @@ class BuildTarget(Target):
|
|||
if cxx_compiler := state.cxx_compiler():
|
||||
env['CXX'] = str(cxx_compiler)
|
||||
|
||||
for prefix in ('CPP', 'C', 'CXX', 'OBJC', 'OBJCXX'):
|
||||
var_name = f'{prefix}FLAGS'
|
||||
for prefix in ('C', 'CPP', 'CXX', 'OBJC', 'OBJCXX'):
|
||||
state.update_flags_environment_variable(f'{prefix}FLAGS', f'-I{state.include_path}')
|
||||
|
||||
state.update_environment(var_name, f'-I{state.include_path}')
|
||||
state.set_sdk(var_name)
|
||||
state.set_os_version(var_name)
|
||||
|
||||
ldflags = 'LDFLAGS'
|
||||
|
||||
state.update_environment(ldflags, f'-L{state.lib_path}')
|
||||
state.set_sdk(ldflags)
|
||||
state.set_os_version(ldflags)
|
||||
state.update_flags_environment_variable('LDFLAGS', f'-L{state.lib_path}')
|
||||
|
||||
def install(self, state: BuildState, options: CommandLineOptions = None, tool: str = 'gmake'):
|
||||
if state.xcode:
|
||||
|
|
Loading…
Reference in a new issue