From a3c6564682e58d41effc5b1c17ca789a29b3d8a0 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Wed, 30 Apr 2025 16:48:24 +0200 Subject: (runtimes) fix support of macOS homebrew llvm for --runtimes --- xmake/modules/core/tools/clang.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xmake/modules/core/tools/clang.lua b/xmake/modules/core/tools/clang.lua index 1b16d2710..4dc6cd415 100644 --- a/xmake/modules/core/tools/clang.lua +++ b/xmake/modules/core/tools/clang.lua @@ -284,6 +284,12 @@ function nf_runtime(self, runtime, opt) local libdir = path.absolute(path.join(llvm_rootdir, "lib")) maps["c++_static"] = table.join(maps["c++_static"], "-L" .. libdir) maps["c++_shared"] = table.join(maps["c++_shared"], "-L" .. libdir) + -- sometimes llvm c++ runtimes are located in c++ subfolder (e.g homebrew llvm) + local cxx_libdir = path.join(libdir, "c++") + if os.isdir(cxx_libdir) then + maps["c++_static"] = table.join(maps["c++_static"], "-L" .. cxx_libdir) + maps["c++_shared"] = table.join(maps["c++_shared"], "-L" .. cxx_libdir) + end -- sometimes llvm runtimes are located in a target-triple subfolder local target_triple = _get_llvm_target_triple(self) local triple_libdir = (target_triple and os.isdir(path.join(libdir, target_triple))) and path.join(libdir, target_triple) -- cgit v1.3.1