add support for libc++ runtimes for boost (#3311)

* add support for libc++ runtimes for boost

* apply PR suggestions

* Update xmake.lua

---------

Co-authored-by: ruki <waruqi@gmail.com>
pull/3334/head
Arthur Laurent 1 year ago committed by GitHub
parent 7228a42720
commit 3b582fd586
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      packages/b/boost/xmake.lua

@ -200,6 +200,10 @@ package("boost")
"--without-icu"
}
if package:has_tool("cxx", "clang", "clangxx") then
table.insert(bootstrap_argv, "--with-toolset=clang")
end
if package:is_plat("windows") then
-- for bootstrap.bat, all other arguments are useless
bootstrap_argv = { "msvc" }
@ -265,6 +269,7 @@ package("boost")
table.insert(argv, "address-model=32")
end
local cxxflags
local linkflags
if package:is_plat("windows") then
local vs_runtime = package:config("vs_runtime")
if package:config("shared") then
@ -302,9 +307,19 @@ package("boost")
cxxflags = cxxflags .. " -fPIC"
end
end
if package.has_runtime and package:has_runtime("c++_shared", "c++_static") then
cxxflags = (cxxflags or "") .. " -stdlib=libc++"
linkflags = (linkflags or "") .. " -stdlib=libc++"
if package:has_runtime("c++_static") then
linkflags = linkflags .. " -static-libstdc++"
end
end
if cxxflags then
table.insert(argv, "cxxflags=" .. cxxflags)
end
if linkflags then
table.insert(argv, "linkflags=" .. linkflags)
end
for _, libname in ipairs(libnames) do
if package:config("all") or package:config(libname) then
table.insert(argv, "--with-" .. libname)

Loading…
Cancel
Save