aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/compilers.py8
-rw-r--r--mesonbuild/compilers/mixins/clike.py6
2 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index ef0ea70..5849d8c 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -322,9 +322,9 @@ def get_base_compile_args(options: 'KeyedOptionDictType', compiler: 'Compiler',
if option_enabled(compiler.base_options, options, OptionKey('b_bitcode')):
args.append('-fembed-bitcode')
try:
- crt_val = options[OptionKey('b_vscrt')].value
- buildtype = options[OptionKey('buildtype')].value
try:
+ crt_val = options.get_value(OptionKey('b_vscrt'))
+ buildtype = options.get_value(OptionKey('buildtype'))
args += compiler.get_crt_compile_args(crt_val, buildtype)
except AttributeError:
pass
@@ -390,9 +390,9 @@ def get_base_link_args(options: 'KeyedOptionDictType', linker: 'Compiler',
args.extend(linker.get_allow_undefined_link_args())
try:
- crt_val = options[OptionKey('b_vscrt')].value
- buildtype = options[OptionKey('buildtype')].value
try:
+ crt_val = options.get_value(OptionKey('b_vscrt'))
+ buildtype = options.get_value(OptionKey('buildtype'))
args += linker.get_crt_link_args(crt_val, buildtype)
except AttributeError:
pass
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index 87cb819..70e81a4 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -26,7 +26,7 @@ from ... import arglist
from ... import mesonlib
from ... import mlog
from ...linkers.linkers import GnuLikeDynamicLinkerMixin, SolarisDynamicLinker, CompCertDynamicLinker
-from ...mesonlib import LibType, OptionKey
+from ...mesonlib import LibType
from .. import compilers
from ..compilers import CompileCheckMode
from .visualstudio import VisualStudioLikeCompiler
@@ -376,8 +376,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.optstore[OptionKey('b_vscrt')].value
- buildtype = env.coredata.optstore[OptionKey('buildtype')].value
+ crt_val = env.coredata.optstore.get_value('b_vscrt')
+ buildtype = env.coredata.optstore.get_value('buildtype')
cargs += self.get_crt_compile_args(crt_val, buildtype)
except (KeyError, AttributeError):
pass