boost: improve patch (#4710)

pull/4714/head
star9029 4 months ago committed by GitHub
parent 003f634465
commit a6204e34ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 22
      packages/b/boost/patches/1.85.0/fix-v144.patch
  2. 26
      packages/b/boost/xmake.lua

@ -0,0 +1,22 @@
diff --git a/tools/build/src/tools/msvc.jam b/tools/build/src/tools/msvc.jam
index 54a6ced..bac3932 100644
--- a/tools/build/src/tools/msvc.jam
+++ b/tools/build/src/tools/msvc.jam
@@ -1137,7 +1137,7 @@ local rule generate-setup-cmd ( version : command : parent : options * : cpu : g
}
else
{
- if [ MATCH "(14.3)" : $(version) ]
+ if [ MATCH "(14.[34])" : $(version) ]
{
if $(.debug-configuration)
{
@@ -1316,7 +1316,7 @@ local rule configure-really ( version ? : options * )
# version from the path.
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
# 9.0express as 9.0 here.
- if [ MATCH "(MSVC\\\\14.3)" : $(command) ]
+ if [ MATCH "(MSVC\\\\14.[34])" : $(command) ]
{
version = 14.3 ;
}

@ -153,6 +153,17 @@ package("boost")
package:add("deps", "xz")
end
end
if package:is_plat("windows") and package:version():le("1.85.0") then
local vs_toolset = package:toolchain("msvc"):config("vs_toolset")
if vs_toolset then
local vs_toolset_ver = import("core.base.semver").new(vs_toolset)
local minor = vs_toolset_ver:minor()
if minor and minor >= 40 then
package:add("patches", "<=1.85.0", "patches/1.85.0/fix-v144.patch", "1ba99cb2e2f03a4ba489a32596c62e1310b6c73ba4d19afa8796bcf180c84422")
end
end
end
end)
on_install("macosx", "linux", "windows", "bsd", "mingw", "cross", function (package)
@ -388,21 +399,6 @@ package("boost")
if package:is_plat("linux") then
table.insert(argv, "pch=off")
end
if package:is_plat("windows") and package:version():le("1.85.0") then
local vs_toolset = build_toolchain:config("vs_toolset")
if vs_toolset then
local vs_toolset_ver = import("core.base.semver").new(vs_toolset)
local minor = vs_toolset_ver:minor()
if minor and minor >= 40 then
io.replace("tools/build/src/engine/config_toolset.bat", "vc143", "vc144", {plain = true})
io.replace("tools/build/src/engine/build.bat", "vc143", "vc144", {plain = true})
io.replace("tools/build/src/engine/guess_toolset.bat", "vc143", "vc144", {plain = true})
io.replace("tools/build/src/tools/intel-win.jam", "14.3", "14.4", {plain = true})
io.replace("tools/build/src/tools/msvc.jam", "14.3", "14.4", {plain = true})
end
end
end
local ok = os.execv("./b2", argv, {envs = runenvs, try = true, stdout = "boost-log.txt"})
if ok ~= 0 then
raise("boost build failed, please check log in " .. path.join(os.curdir(), "boost-log.txt"))

Loading…
Cancel
Save