aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/windows.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-01-05 21:44:31 +0200
committerGitHub <noreply@github.com>2019-01-05 21:44:31 +0200
commit1aca899a63ef287c6fb06e5383f6355b5e75d6d2 (patch)
treec0a77585ae3dbb716b5b51557486ffc25ef4dadf /mesonbuild/modules/windows.py
parent26437f0297bd9dcf4411d4591679724d59e1c312 (diff)
parente147054d6f8b78b306125fd785603ca0519fdfc1 (diff)
downloadmeson-1aca899a63ef287c6fb06e5383f6355b5e75d6d2.zip
meson-1aca899a63ef287c6fb06e5383f6355b5e75d6d2.tar.gz
meson-1aca899a63ef287c6fb06e5383f6355b5e75d6d2.tar.bz2
Merge pull request #4445 from Ericson2314/no-cross_info
Parsing of cross file upfront, and store in cross-agnostic data structures
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)