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

+ 6 - 4
packages/l/libpng/xmake.lua

@@ -12,16 +12,18 @@ package("libpng")
     set_license("libpng-2.0")
     set_license("libpng-2.0")
 
 
     add_deps("zlib")
     add_deps("zlib")
-    if is_host("windows") then
+    if is_host("windows", "mingw") then
         add_deps("cmake")
         add_deps("cmake")
     end
     end
 
 
-    on_install("windows", function (package)
-        local configs = {"-DPNG_TESTS=OFF",
+    on_install("windows", "mingw", function (package)
+        local configs = {"-DPNG_TESTS=OFF", "-DPNG_BUILD_ZLIB=ON", "-DPNG_EXECUTABLES=OFF",
                          "-DPNG_SHARED=" .. (package:config("shared") and "ON" or "OFF"),
                          "-DPNG_SHARED=" .. (package:config("shared") and "ON" or "OFF"),
                          "-DPNG_STATIC=" .. (package:config("shared") and "OFF" or "ON"),
                          "-DPNG_STATIC=" .. (package:config("shared") and "OFF" or "ON"),
                          "-DPNG_DEBUG=" .. (package:debug() and "ON" or "OFF")}
                          "-DPNG_DEBUG=" .. (package:debug() and "ON" or "OFF")}
-        import("package.tools.cmake").install(package, configs)
+        local zlib = assert(package:dep("zlib"):fetch(), "zlib not found!")
+        io.replace("CMakeLists.txt", "${ZLIB_LIBRARY}", table.unwrap(zlib.links), {plain = true})
+        import("package.tools.cmake").install(package, configs, {packagedeps = "zlib"})
     end)
     end)
 
 
     on_install("iphoneos", "android@linux,macosx", "macosx", "linux", function (package)
     on_install("iphoneos", "android@linux,macosx", "macosx", "linux", function (package)

+ 3 - 3
packages/l/libtiff/xmake.lua

@@ -8,12 +8,12 @@ package("libtiff")
     add_versions("4.1.0", "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634")
     add_versions("4.1.0", "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634")
 
 
     add_deps("zlib")
     add_deps("zlib")
-    if is_plat("windows") then
+    if is_plat("windows", "mingw") then
         add_deps("cmake")
         add_deps("cmake")
     end
     end
 
 
-    on_install("windows", function (package)
-        local configs = {}
+    on_install("windows", "mingw", function (package)
+        local configs = {"-Dzstd=OFF", "-Dlzma=OFF", "-Dwebp=OFF", "-Djpeg12=OFF", "-Djbig=OFF", "-Dpixarlog=OFF"}
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         import("package.tools.cmake").install(package, configs)
         import("package.tools.cmake").install(package, configs)
     end)
     end)

+ 1 - 1
packages/l/libwebp/xmake.lua

@@ -26,7 +26,7 @@ package("libwebp")
         add_syslinks("pthread")
         add_syslinks("pthread")
     end
     end
 
 
-    on_install("linux", "macosx", "windows", function (package)
+    on_install("linux", "macosx", "windows", "mingw", function (package)
         local configs = {}
         local configs = {}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         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"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))