|
|
@ -1228,19 +1228,26 @@ def get_global_options(lang: str, |
|
|
|
largkey = argkey.evolve('link_args') |
|
|
|
largkey = argkey.evolve('link_args') |
|
|
|
envkey = argkey.evolve('env_args') |
|
|
|
envkey = argkey.evolve('env_args') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comp_key = argkey if argkey in env.options else envkey |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comp_options = env.options.get(comp_key, []) |
|
|
|
|
|
|
|
link_options = env.options.get(largkey, []) |
|
|
|
|
|
|
|
|
|
|
|
cargs = coredata.UserArrayOption( |
|
|
|
cargs = coredata.UserArrayOption( |
|
|
|
description + ' compiler', |
|
|
|
description + ' compiler', |
|
|
|
env.options.get(argkey, []), split_args=True, user_input=True, allow_dups=True) |
|
|
|
comp_options, split_args=True, user_input=True, allow_dups=True) |
|
|
|
# the compiler args always gets the environemtn variable arguments |
|
|
|
|
|
|
|
cargs.extend_value(env.options.get(envkey, [])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
largs = coredata.UserArrayOption( |
|
|
|
largs = coredata.UserArrayOption( |
|
|
|
description + ' linker', |
|
|
|
description + ' linker', |
|
|
|
env.options.get(largkey, []), split_args=True, user_input=True, allow_dups=True) |
|
|
|
link_options, split_args=True, user_input=True, allow_dups=True) |
|
|
|
# The linker gets the compiler environment variable only if the comiler |
|
|
|
|
|
|
|
# acts as the linker |
|
|
|
if comp.INVOKES_LINKER and comp_key == envkey: |
|
|
|
if comp.INVOKES_LINKER: |
|
|
|
# If the compiler acts as a linker driver, and we're using the |
|
|
|
largs.extend_value(env.options.get(envkey, [])) |
|
|
|
# environment variable flags for both the compiler and linker |
|
|
|
|
|
|
|
# arguments, then put the compiler flags in the linker flags as well. |
|
|
|
|
|
|
|
# This is how autotools works, and the env vars freature is for |
|
|
|
|
|
|
|
# autotools compatibility. |
|
|
|
|
|
|
|
largs.extend_value(comp_options) |
|
|
|
|
|
|
|
|
|
|
|
opts: 'KeyedOptionDictType' = {argkey: cargs, largkey: largs} |
|
|
|
opts: 'KeyedOptionDictType' = {argkey: cargs, largkey: largs} |
|
|
|
|
|
|
|
|
|
|
|