aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-05-11 09:07:34 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-11-14 15:57:37 -0800
commitf159735c3b82849d0c5d33345b7b07a5f5024428 (patch)
tree5dc3572f3ff140444e02d3fb5797948fb87332f6
parentcaf1066cd198ecf66cc5a4e2958627e5a4a5c26b (diff)
downloadmeson-f159735c3b82849d0c5d33345b7b07a5f5024428.zip
meson-f159735c3b82849d0c5d33345b7b07a5f5024428.tar.gz
meson-f159735c3b82849d0c5d33345b7b07a5f5024428.tar.bz2
modules/windows: Allow getting windres from native file
-rw-r--r--mesonbuild/modules/windows.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py
index 85cc3bc..96f3a7e 100644
--- a/mesonbuild/modules/windows.py
+++ b/mesonbuild/modules/windows.py
@@ -59,6 +59,14 @@ class WindowsModule(ExtensionModule):
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.
+ _win = state.environment.config_info.binaries.get('windres')
+ if _win:
+ rescomp = ExternalProgram('windres', command=_win, silent=True)
+
+ if not rescomp or not rescomp.found():
comp = self.detect_compiler(state.compilers)
if comp.id == 'msvc' or comp.id == 'clang-cl':
rescomp = ExternalProgram('rc', silent=True)