aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/windows.py
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-09 16:06:55 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2019-01-02 16:22:47 -0500
commit2b22576fb6a8bb52434068d95eff188a201e6bc5 (patch)
treeb169c0c8c5cf56f68cf8a1d75f35a0fb71ad295f /mesonbuild/modules/windows.py
parentdbf080afe99a8bbb04a3bfb19a81363d3b78e7b4 (diff)
downloadmeson-2b22576fb6a8bb52434068d95eff188a201e6bc5.zip
meson-2b22576fb6a8bb52434068d95eff188a201e6bc5.tar.gz
meson-2b22576fb6a8bb52434068d95eff188a201e6bc5.tar.bz2
Remove cross_info; cross file is parsed up front and discarded
Diffstat (limited to 'mesonbuild/modules/windows.py')
-rw-r--r--mesonbuild/modules/windows.py22
1 files changed, 3 insertions, 19 deletions
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py
index d185d89..e8d266e 100644
--- a/mesonbuild/modules/windows.py
+++ b/mesonbuild/modules/windows.py
@@ -41,29 +41,13 @@ class WindowsModule(ExtensionModule):
def _find_resource_compiler(self, state):
# FIXME: Does not handle `native: true` executables, see
# See https://github.com/mesonbuild/meson/issues/1531
+ # But given a machine, we can un-hardcode `binaries.host` below.
if hasattr(self, '_rescomp'):
return self._rescomp
- rescomp = None
- if state.environment.is_cross_build():
- # If cross compiling see if windres has been specified in the
- # cross file before trying to find it another way.
- bins = state.environment.cross_info.config['binaries']
- rescomp = ExternalProgram.from_bin_list(bins, 'windres')
-
- if not rescomp or not rescomp.found():
- if 'WINDRES' in os.environ:
- # Pick-up env var WINDRES if set. This is often used for
- # specifying an arch-specific windres.
- rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES'), silent=True)
-
- if not rescomp or not rescomp.found():
- # Take windres from the config file after the environment, which is
- # in keeping with the expectations on unix-like OSes that
- # environment variables trump config files.
- bins = state.environment.config_info.binaries
- rescomp = ExternalProgram.from_bin_list(bins, 'windres')
+ # Will try cross / native file and then env var
+ rescomp = ExternalProgram.from_bin_list(state.environment.binaries.host, 'windres')
if not rescomp or not rescomp.found():
comp = self.detect_compiler(state.compilers)