diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-12-04 17:01:45 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-01-04 12:20:58 -0800 |
commit | e81acbd6069e8c1ae8e3be7bb83ddc239009d42d (patch) | |
tree | b08545b2844650ed95e42ade00ecb1cd3fb85b88 /mesonbuild/compilers | |
parent | 71db6b04a31707674ad776be1cf22f667056d56b (diff) | |
download | meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.zip meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.tar.gz meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.tar.bz2 |
Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 4 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/emscripten.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index 0f30f55..3288c00 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -394,8 +394,8 @@ 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[OptionKey('b_vscrt')].value - buildtype = env.coredata.builtins[OptionKey('buildtype')].value + crt_val = env.coredata.options[OptionKey('b_vscrt')].value + buildtype = env.coredata.options[OptionKey('buildtype')].value cargs += self.get_crt_compile_args(crt_val, buildtype) except (KeyError, AttributeError): pass diff --git a/mesonbuild/compilers/mixins/emscripten.py b/mesonbuild/compilers/mixins/emscripten.py index 537ae92..fc0b21e 100644 --- a/mesonbuild/compilers/mixins/emscripten.py +++ b/mesonbuild/compilers/mixins/emscripten.py @@ -51,7 +51,7 @@ class EmscriptenMixin(Compiler): def thread_link_flags(self, env: 'Environment') -> T.List[str]: args = ['-s', 'USE_PTHREADS=1'] - count: int = env.coredata.compiler_options[OptionKey('thread_count', lang=self.language, machine=self.for_machine)].value + count: int = env.coredata.options[OptionKey('thread_count', lang=self.language, machine=self.for_machine)].value if count: args.extend(['-s', 'PTHREAD_POOL_SIZE={}'.format(count)]) return args |