2
0
ruki 4 жил өмнө
parent
commit
ac16377a97

+ 2 - 1
.github/workflows/windows.yml

@@ -10,6 +10,7 @@ jobs:
       matrix:
         os: [windows-latest]
         kind: [static, shared]
+        arch: [x64, x86]
 
     runs-on: ${{ matrix.os }}
 
@@ -21,5 +22,5 @@ jobs:
 
       - name: Tests
         run: |
-          xmake l ./scripts/test.lua -D -k ${{ matrix.kind }} --vs_sdkver=10.0.19041.0
+          xmake l ./scripts/test.lua -D -a ${{ matrix.arch }} -k ${{ matrix.kind }} --vs_sdkver=10.0.19041.0
 

+ 9 - 9
packages/t/tinyxml2/xmake.lua

@@ -7,13 +7,14 @@ package("tinyxml2")
     add_urls("https://github.com/leethomason/tinyxml2.git")
     add_versions("8.0.0", "6ce574fbb46751842d23089485ae73d3db12c1b6639cda7721bf3a7ee862012c")
 
-    on_install("linux", "macosx", "windows", function (package)
-        local config = {}
-
-        table.insert(config, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
-        table.insert(config, "-DBUILD_TESTS=OFF")
+    if is_plat("linux", "macosx", "windows") then
+        add_deps("cmake")
+    end
 
-        import("package.tools.cmake").install(package, config)
+    on_install("linux", "macosx", "windows", function (package)
+        local configs = {"-DBUILD_TESTS=OFF"}
+        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:configs("shared") and "ON" or "OFF"))
+        import("package.tools.cmake").install(package, configs)
     end)
 
     on_install("mingw", "android", "iphoneos", function (package)
@@ -25,8 +26,7 @@ package("tinyxml2")
                 add_headerfiles("tinyxml2.h")
                 add_files("tinyxml2.cpp")
         ]])
-
-        import("package.tools.xmake").install(package, {kind = package:config("shared")  and "shared" or "static"})
+        import("package.tools.xmake").install(package, {kind = package:configs("shared")  and "shared" or "static"})
     end)
 
     on_test(function (package)
@@ -37,4 +37,4 @@ package("tinyxml2")
                 doc.Parse(xml);
             }
         ]]}, {configs = {languages = "c++11"}, includes = "tinyxml2.h"}))
-    end)
+    end)