aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2019-05-08 14:39:58 +0100
committerDylan Baker <dylan@pnwbakers.com>2019-05-20 11:29:17 -0700
commit58870fda1666c43a8bb793b52f658e37f4d51c67 (patch)
treeec0aeef775ee287271413f3ecd38c6f4d8d9d361 /mesonbuild
parentcf662ded46076c053ee1d30761fdc6d8a7b089a4 (diff)
downloadmeson-58870fda1666c43a8bb793b52f658e37f4d51c67.zip
meson-58870fda1666c43a8bb793b52f658e37f4d51c67.tar.gz
meson-58870fda1666c43a8bb793b52f658e37f4d51c67.tar.bz2
Remove compilers from ModuleState object
It doesn't make much sense to have this and not also have cross-compilers (so any use of this is already pretty suspect as probably wrong when cross-compiling). This information is accessible anyhow via environment.coredata.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter.py3
-rw-r--r--mesonbuild/modules/cmake.py5
-rw-r--r--mesonbuild/modules/windows.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 4a91b68..766a22f 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1633,7 +1633,7 @@ class CompilerHolder(InterpreterObject):
ModuleState = namedtuple('ModuleState', [
'build_to_src', 'subproject', 'subdir', 'current_lineno', 'environment',
- 'project_name', 'project_version', 'backend', 'compilers', 'targets',
+ 'project_name', 'project_version', 'backend', 'targets',
'data', 'headers', 'man', 'global_args', 'project_args', 'build_machine',
'host_machine', 'target_machine', 'current_node'])
@@ -1668,7 +1668,6 @@ class ModuleHolder(InterpreterObject, ObjectHolder):
# The backend object is under-used right now, but we will need it:
# https://github.com/mesonbuild/meson/issues/1419
backend=self.interpreter.backend,
- compilers=self.interpreter.build.compilers,
targets=self.interpreter.build.targets,
data=self.interpreter.build.data,
headers=self.interpreter.build.get_headers(),
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py
index 6af4adb..d72ceca 100644
--- a/mesonbuild/modules/cmake.py
+++ b/mesonbuild/modules/cmake.py
@@ -52,7 +52,8 @@ class CmakeModule(ExtensionModule):
super().__init__(interpreter)
self.snippets.add('configure_package_config_file')
- def detect_voidp_size(self, compilers, env):
+ def detect_voidp_size(self, env):
+ compilers = env.coredata.compilers
compiler = compilers.get('c', None)
if not compiler:
compiler = compilers.get('cpp', None)
@@ -115,7 +116,7 @@ class CmakeModule(ExtensionModule):
conf = {
'CVF_VERSION': (version, ''),
- 'CMAKE_SIZEOF_VOID_P': (str(self.detect_voidp_size(state.compilers, state.environment)), '')
+ 'CMAKE_SIZEOF_VOID_P': (str(self.detect_voidp_size(state.environment)), '')
}
mesonlib.do_conf_file(template_file, version_file, conf, 'meson')
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py
index e2fd9a8..3b4eb15 100644
--- a/mesonbuild/modules/windows.py
+++ b/mesonbuild/modules/windows.py
@@ -50,7 +50,7 @@ class WindowsModule(ExtensionModule):
rescomp = ExternalProgram.from_bin_list(state.environment.binaries.host, 'windres')
if not rescomp or not rescomp.found():
- comp = self.detect_compiler(state.compilers)
+ comp = self.detect_compiler(state.environment.coredata.compilers)
if comp.id in {'msvc', 'clang-cl', 'intel-cl'}:
rescomp = ExternalProgram('rc', silent=True)
else: