summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorLuca Bacci <luca.bacci982@gmail.com>2025-09-10 15:40:24 +0200
committerDylan Baker <dylan@pnwbakers.com>2025-11-18 08:47:07 -0800
commit1e99097f9be5b64d53bc5aab5c739962d6ce4c38 (patch)
tree6ce6f581265461fc4720e573a1dadc0c7425343d /mesonbuild
parentd49ab9242e1e7e673827b488fca81265c223b5b9 (diff)
downloadmeson-1e99097f9be5b64d53bc5aab5c739962d6ce4c38.tar.gz
modules/windows: Also search for llvm-rc and llvm-windres
Fixes #15011
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/modules/windows.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py
index 17fc8abe4..3250c072c 100644
--- a/mesonbuild/modules/windows.py
+++ b/mesonbuild/modules/windows.py
@@ -75,14 +75,20 @@ class WindowsModule(ExtensionModule):
rescomp = ExternalProgram.from_bin_list(state.environment, for_machine, 'windres')
if not rescomp or not rescomp.found():
+ def search_programs(names: T.List[str]) -> T.Optional[ExternalProgram]:
+ for name in names:
+ program = ExternalProgram(name, silent=True)
+ if program.found():
+ return program
+ return None
+
comp = self.detect_compiler(state.environment.coredata.compilers[for_machine])
if comp.id in {'msvc', 'clang-cl', 'intel-cl'} or (comp.linker and comp.linker.id in {'link', 'lld-link'}):
- # Microsoft compilers uses rc irrespective of the frontend
- rescomp = ExternalProgram('rc', silent=True)
+ rescomp = search_programs(['rc', 'llvm-rc'])
else:
- rescomp = ExternalProgram('windres', silent=True)
+ rescomp = search_programs(['windres', 'llvm-windres'])
- if not rescomp.found():
+ if not rescomp:
raise MesonException('Could not find Windows resource compiler')
for (arg, match, rc_type) in [