Pārlūkot izejas kodu

Try resolve https://github.com/xmake-io/xmake-repo/pull/6644 (#6744)

Saikari 5 mēneši atpakaļ
vecāks
revīzija
49b3868288
1 mainītis faili ar 17 papildinājumiem un 4 dzēšanām
  1. 17 4
      packages/w/webthing-cpp/xmake.lua

+ 17 - 4
packages/w/webthing-cpp/xmake.lua

@@ -7,21 +7,34 @@ package("webthing-cpp")
     add_urls("https://github.com/bw-hro/webthing-cpp/archive/refs/tags/$(version).tar.gz",
     add_urls("https://github.com/bw-hro/webthing-cpp/archive/refs/tags/$(version).tar.gz",
              "https://github.com/bw-hro/webthing-cpp.git")
              "https://github.com/bw-hro/webthing-cpp.git")
 
 
+    add_versions("v1.2.0", "95d527bf8e2cef9221a42519b4798fda7d0866abd7ccaf21d57a629168a94ccc")
     add_versions("v1.1.0", "7f32651813168b7a51f95005be626cfaf30868db134a5bf9ca491a9d07949f5a")
     add_versions("v1.1.0", "7f32651813168b7a51f95005be626cfaf30868db134a5bf9ca491a9d07949f5a")
 
 
     add_configs("ssl", {description = "Build with SSL", default = true, type = "boolean"})
     add_configs("ssl", {description = "Build with SSL", default = true, type = "boolean"})
 
 
-    add_deps("cmake", "mdns", "libuv", "zlib", "json-schema-validator", "uwebsockets")
-    add_deps("usockets", {configs = {ssl = "openssl3"}})
+    if is_plat("windows") then
+        add_deps("pkgconf")
+    else
+        add_deps("pkg-config")
+    end
+
+    add_deps("cmake", "mdns", "libuv", "zlib", "json-schema-validator")
+    add_deps("uwebsockets", {configs = {zip = true}})
+    add_deps("usockets", {configs = {ssl = "openssl"}})
     add_deps("nlohmann_json", {configs = {cmake = true}})
     add_deps("nlohmann_json", {configs = {cmake = true}})
 
 
     on_load(function (package)
     on_load(function (package)
         if package:config("ssl") then
         if package:config("ssl") then
-            package:add("deps", "openssl3")
+            package:add("deps", "openssl")
         end
         end
     end)
     end)
 
 
-    on_install("linux", "macosx", function (package)
+    on_install("linux", "macosx", "windows", function (package)
+        io.replace("CMakeLists.txt", "find_package(unofficial-uwebsockets CONFIG REQUIRED)", [[
+            find_package(PkgConfig QUIET)
+            pkg_check_modules(uwebsockets REQUIRED IMPORTED_TARGET uwebsockets)
+        ]], {plain = true})
+        io.replace("CMakeLists.txt", "unofficial::uwebsockets::uwebsockets", "PkgConfig::uwebsockets")
         local configs = {"-DWT_BUILD_EXAMPLES=OFF", "-DWT_BUILD_TESTS=OFF"}
         local configs = {"-DWT_BUILD_EXAMPLES=OFF", "-DWT_BUILD_TESTS=OFF"}
         table.insert(configs, "-DWT_WITH_SSL=" .. (package:config("ssl") and "ON" or "OFF"))
         table.insert(configs, "-DWT_WITH_SSL=" .. (package:config("ssl") and "ON" or "OFF"))
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))