From 2b1e2066822cea6cd6e9ef432090481150404846 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 4 Sep 2023 02:17:19 +0300 Subject: [PATCH] Use architecture-dependent filename pattern when looking for binaries --- source/lib/virtualfilesystem.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/lib/virtualfilesystem.cpp b/source/lib/virtualfilesystem.cpp index ecd145b..de4fb35 100644 --- a/source/lib/virtualfilesystem.cpp +++ b/source/lib/virtualfilesystem.cpp @@ -168,9 +168,14 @@ FileTarget *VirtualFileSystem::find_binary(const string &name) path.push_back(builder.get_prefix()/"bin"); } + string exe_name = name; + vector exe_patterns = builder.get_current_arch().get_patterns(); + if(!exe_patterns.empty()) + exe_name = exe_patterns.front().apply(name); + for(const FS::Path &p: path) { - FS::Path filename = p/name; + FS::Path filename = p/exe_name; if(FileTarget *tgt = get_target(filename)) { builder.get_logger().log("vfs", "Binary %s found in %s as existing %s", name, p, tgt->get_type()); -- 2.45.2