浏览代码

boost: improve patch (#4710)

star9029 1 年之前
父节点
当前提交
a6204e34ab
共有 2 个文件被更改,包括 33 次插入15 次删除
  1. 22 0
      packages/b/boost/patches/1.85.0/fix-v144.patch
  2. 11 15
      packages/b/boost/xmake.lua

+ 22 - 0
packages/b/boost/patches/1.85.0/fix-v144.patch

@@ -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 ;
+             }

+ 11 - 15
packages/b/boost/xmake.lua

@@ -153,6 +153,17 @@ package("boost")
                 package:add("deps", "xz")
                 package:add("deps", "xz")
             end
             end
         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)
     end)
 
 
     on_install("macosx", "linux", "windows", "bsd", "mingw", "cross", function (package)
     on_install("macosx", "linux", "windows", "bsd", "mingw", "cross", function (package)
@@ -388,21 +399,6 @@ package("boost")
         if package:is_plat("linux") then
         if package:is_plat("linux") then
             table.insert(argv, "pch=off")
             table.insert(argv, "pch=off")
         end
         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"})
         local ok = os.execv("./b2", argv, {envs = runenvs, try = true, stdout = "boost-log.txt"})
         if ok ~= 0 then
         if ok ~= 0 then
             raise("boost build failed, please check log in " .. path.join(os.curdir(), "boost-log.txt"))
             raise("boost build failed, please check log in " .. path.join(os.curdir(), "boost-log.txt"))