diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2020-12-04 16:09:10 -0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2021-01-04 12:20:40 -0800 |
| commit | 71db6b04a31707674ad776be1cf22f667056d56b (patch) | |
| tree | b62c0721557766ddc2034e740960d00a37cd9991 /mesonbuild/compilers/mixins/clike.py | |
| parent | f9b19e73a5b87a2f3c8506cf19cfd5bbc468e938 (diff) | |
| download | meson-71db6b04a31707674ad776be1cf22f667056d56b.tar.gz | |
use OptionKey for builtin and base options
I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.
this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
Diffstat (limited to 'mesonbuild/compilers/mixins/clike.py')
| -rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index dca09ea78..0f30f55c2 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -35,6 +35,7 @@ from ... import mesonlib from ... import mlog from ...linkers import GnuLikeDynamicLinkerMixin, SolarisDynamicLinker, CompCertDynamicLinker from ...mesonlib import LibType +from ...coredata import OptionKey from .. import compilers from ..compilers import CompileCheckMode from .visualstudio import VisualStudioLikeCompiler @@ -393,14 +394,16 @@ class CLikeCompiler(Compiler): # linking with static libraries since MSVC won't select a CRT for # us in that case and will error out asking us to pick one. try: - crt_val = env.coredata.base_options['b_vscrt'].value - buildtype = env.coredata.builtins['buildtype'].value + crt_val = env.coredata.base_options[OptionKey('b_vscrt')].value + buildtype = env.coredata.builtins[OptionKey('buildtype')].value cargs += self.get_crt_compile_args(crt_val, buildtype) except (KeyError, AttributeError): pass # Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS and CPPFLAGS from the env sys_args = env.coredata.get_external_args(self.for_machine, self.language) + if isinstance(sys_args, str): + sys_args = [sys_args] # Apparently it is a thing to inject linker flags both # via CFLAGS _and_ LDFLAGS, even though the former are # also used during linking. These flags can break |
