Parcourir la source

improve workflow (#928)

* improve workflow

* Update xmake.lua
ruki il y a 3 ans
Parent
commit
6f77b6ec11
1 fichiers modifiés avec 10 ajouts et 1 suppressions
  1. 10 1
      packages/w/workflow/xmake.lua

+ 10 - 1
packages/w/workflow/xmake.lua

@@ -20,11 +20,20 @@ package("workflow")
         end
     end )
 
-    on_install("linux", "macosx", function (package)
+    on_install("linux", "macosx", "android", function (package)
         local configs = {}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        if package:is_plat("android") then
+            io.replace("src/CMakeLists.txt", "add_subdirectory(client)", "add_subdirectory(client)\nlink_libraries(ssl crypto)", {plain = true})
+        end
         import("package.tools.cmake").install(package, configs, {packagedeps = "openssl"})
+        if package:config("shared") then
+            os.tryrm(path.join(package:installdir("lib"), "*.a"))
+        else
+            os.tryrm(path.join(package:installdir("lib"), "*.so"))
+            os.tryrm(path.join(package:installdir("lib"), "*.dylib"))
+        end
     end)
 
     on_test(function (package)