From 80ab9a6945654d36b52521df4a5586f21c69e51d Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 17 Apr 2023 23:42:05 +0800 Subject: [PATCH] fix boost for macos (#1996) --- packages/b/boost/xmake.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/b/boost/xmake.lua b/packages/b/boost/xmake.lua index 0d9fd716f..40ab1f602 100644 --- a/packages/b/boost/xmake.lua +++ b/packages/b/boost/xmake.lua @@ -134,7 +134,12 @@ package("boost") if file then if package:is_plat("macosx") then -- we uses ld/clang++ for link stdc++ for shared libraries - file:print("using darwin : : %s ;", package:build_getenv("ld")) + -- and we need `xcrun -sdk macosx clang++` to make b2 to get `-isysroot` automatically + local cc = package:build_getenv("ld") + if cc and cc:find("clang", 1, true) and cc:find("Xcode", 1, true) then + cc = "xcrun -sdk macosx clang++" + end + file:print("using darwin : : %s ;", cc) elseif package:is_plat("windows") then file:print("using msvc : : \"%s\" ;", (package:build_getenv("cxx"):gsub("\\", "\\\\"))) else