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.
This commit is contained in:
parent
cf662ded46
commit
58870fda16
|
@ -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(),
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue