diff options
| author | ruki <[email protected]> | 2025-05-03 22:55:03 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-03 22:55:03 +0800 |
| commit | c3ebef100e839d7d65baa368baf71421e4229578 (patch) | |
| tree | 04a84b2f1c9d4e9c09a05b836d04f8c960454025 | |
| parent | 2774ecbc0961e1e2b1f995d8937b44c2c90e11c6 (diff) | |
| parent | a3c6564682e58d41effc5b1c17ca789a29b3d8a0 (diff) | |
Merge pull request #6379 from Arthapz/fix-homebrew-llvm
(runtimes) fix support of macOS homebrew llvm for --runtimes
| -rw-r--r-- | xmake/modules/core/tools/clang.lua | 6 |
1 files changed, 6 insertions, 0 deletions
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) |
