diff options
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index a4823e2..a37e4da 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1227,22 +1227,18 @@ def get_global_options(lang: str, argkey = OptionKey('args', lang=lang, machine=for_machine) largkey = argkey.evolve('link_args') - # We shouldn't need listify here, but until we have a separate - # linker-driver representation and can have that do the combine we have to - # do it this way. - compile_args = mesonlib.listify(env.options.get(argkey, [])) - link_args = mesonlib.listify(env.options.get(largkey, [])) - + cargs = coredata.UserArrayOption( + description + ' compiler', + env.options.get(argkey, []), split_args=True, user_input=True, allow_dups=True) + largs = coredata.UserArrayOption( + description + ' linker', + env.options.get(largkey, []), split_args=True, user_input=True, allow_dups=True) + + # This needs to be done here, so that if we have string values in the env + # options that we can safely combine them *after* they've been split if comp.INVOKES_LINKER: - link_args = compile_args + link_args - - opts: 'KeyedOptionDictType' = { - argkey: coredata.UserArrayOption( - description + ' compiler', - compile_args, split_args=True, user_input=True, allow_dups=True), - largkey: coredata.UserArrayOption( - description + ' linker', - link_args, split_args=True, user_input=True, allow_dups=True), - } + largs.set_value(largs.value + cargs.value) + + opts: 'KeyedOptionDictType' = {argkey: cargs, largkey: largs} return opts |