aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-12-04 21:28:36 +0000
committerDylan Baker <dylan@pnwbakers.com>2019-05-20 11:29:17 -0700
commitfb35e6faac2a5efbb8fd0ff6ee5627b144adb184 (patch)
tree66a742bc32d10d06058a4eefe2d7f0c74c385292 /mesonbuild
parent3ff758f22d8db14171b0cc31e487a24808dd1648 (diff)
downloadmeson-fb35e6faac2a5efbb8fd0ff6ee5627b144adb184.zip
meson-fb35e6faac2a5efbb8fd0ff6ee5627b144adb184.tar.gz
meson-fb35e6faac2a5efbb8fd0ff6ee5627b144adb184.tar.bz2
Remove compiler data from build object
The actual data is in Coredata (which is serialized) and we just held a reference in Build for (in)convenience.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/build.py7
-rw-r--r--mesonbuild/environment.py4
-rw-r--r--mesonbuild/interpreter.py10
3 files changed, 7 insertions, 14 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 093ab8f..d51e2e3 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -114,9 +114,6 @@ class Build:
self.environment = environment
self.projects = {}
self.targets = OrderedDict()
- # Coredata holds the state. This is just here for convenience.
- self.compilers = environment.coredata.compilers
- self.cross_compilers = environment.coredata.cross_compilers
self.global_args = {}
self.projects_args = {}
self.global_link_args = {}
@@ -149,10 +146,6 @@ class Build:
def copy(self):
other = Build(self.environment)
for k, v in self.__dict__.items():
- if k in ['compilers', 'cross_compilers']:
- # These alias coredata's fields of the same name, and must not
- # become copies.
- continue
if isinstance(v, (list, dict, set, OrderedDict)):
other.__dict__[k] = v.copy()
else:
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index e638f31..1ccdf98 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -411,8 +411,8 @@ class Environment:
# target machine.)
machines = PerThreeMachineDefaultable()
- # Similar to coredata.compilers and build.compilers, but lower level in
- # that there is no meta data, only names/paths.
+ # Similar to coredata.compilers, but lower level in that there is no
+ # meta data, only names/paths.
binaries = PerMachineDefaultable()
# Misc other properties about each machine.
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 766a22f..ea99a43 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1824,9 +1824,9 @@ class MesonMain(InterpreterObject):
if not isinstance(native, bool):
raise InterpreterException('Type of "native" must be a boolean.')
if native:
- clist = self.build.compilers
+ clist = self.interpreter.coredata.compilers
else:
- clist = self.build.cross_compilers
+ clist = self.interpreter.coredata.cross_compilers
if cname in clist:
return CompilerHolder(clist[cname], self.build.environment, self.interpreter.subproject)
raise InterpreterException('Tried to access compiler for unspecified language "%s".' % cname)
@@ -2208,7 +2208,7 @@ class Interpreter(InterpreterBase):
def check_cross_stdlibs(self):
if self.build.environment.is_cross_build():
props = self.build.environment.properties.host
- for l in self.build.cross_compilers.keys():
+ for l in self.coredata.cross_compilers.keys():
try:
di = mesonlib.stringlistify(props.get_stdlib(l))
if len(di) != 2:
@@ -3857,7 +3857,7 @@ different subdirectory.
self.print_extra_warnings()
def print_extra_warnings(self):
- for c in self.build.compilers.values():
+ for c in self.coredata.compilers.values():
if c.get_id() == 'clang':
self.check_clang_asan_lundef()
break
@@ -4074,7 +4074,7 @@ This will become a hard error in the future.''', location=self.current_node)
def get_used_languages(self, target):
result = {}
for i in target.sources:
- for lang, c in self.build.compilers.items():
+ for lang, c in self.coredata.compilers.items():
if c.can_compile(i):
result[lang] = True
break