aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-12-04 16:09:10 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-01-04 12:20:40 -0800
commit71db6b04a31707674ad776be1cf22f667056d56b (patch)
treeb62c0721557766ddc2034e740960d00a37cd9991 /mesonbuild/cmake
parentf9b19e73a5b87a2f3c8506cf19cfd5bbc468e938 (diff)
downloadmeson-71db6b04a31707674ad776be1cf22f667056d56b.zip
meson-71db6b04a31707674ad776be1cf22f667056d56b.tar.gz
meson-71db6b04a31707674ad776be1cf22f667056d56b.tar.bz2
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/cmake')
-rw-r--r--mesonbuild/cmake/executor.py4
-rw-r--r--mesonbuild/cmake/interpreter.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py
index 19971e3..21dfd356 100644
--- a/mesonbuild/cmake/executor.py
+++ b/mesonbuild/cmake/executor.py
@@ -23,7 +23,7 @@ import re
import os
from .. import mlog
-from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice, is_windows
+from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice, is_windows, OptionKey
from ..envconfig import get_env_var
if T.TYPE_CHECKING:
@@ -62,7 +62,7 @@ class CMakeExecutor:
self.cmakebin = None
return
- self.prefix_paths = self.environment.coredata.builtins_per_machine[self.for_machine]['cmake_prefix_path'].value
+ self.prefix_paths = self.environment.coredata.builtins[OptionKey('cmake_prefix_path', machine=self.for_machine)].value
env_pref_path_raw = get_env_var(
self.for_machine,
self.environment.is_cross_build(),
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py
index 5931fd1..5d2dd7f 100644
--- a/mesonbuild/cmake/interpreter.py
+++ b/mesonbuild/cmake/interpreter.py
@@ -578,7 +578,7 @@ class ConverterTarget:
@lru_cache(maxsize=None)
def _all_lang_stds(self, lang: str) -> T.List[str]:
try:
- res = self.env.coredata.compiler_options[OptionKey('std', machine=MachineChoice.BUILD, lang=lang)].choices # type: ignore
+ res = self.env.coredata.compiler_options[OptionKey('std', machine=MachineChoice.BUILD, lang=lang)].choices
except KeyError:
return []