From 2aa64483984a15761e5ae6cc9ce294d6233253d5 Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 24 Sep 2024 11:27:30 +0800 Subject: [PATCH] zlib: add dll macro (#5327) --- packages/z/zlib/xmake.lua | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/z/zlib/xmake.lua b/packages/z/zlib/xmake.lua index 50b0a6fc3..6826aa01e 100644 --- a/packages/z/zlib/xmake.lua +++ b/packages/z/zlib/xmake.lua @@ -1,11 +1,11 @@ package("zlib") - set_homepage("http://www.zlib.net") set_description("A Massively Spiffy Yet Delicately Unobtrusive Compression Library") set_license("zlib") - add_urls("https://github.com/madler/zlib/archive/$(version).tar.gz") - add_urls("https://github.com/madler/zlib.git") + add_urls("https://github.com/madler/zlib/archive/refs/tags/$(version).tar.gz", + "https://github.com/madler/zlib.git") + add_versions("v1.2.10", "42cd7b2bdaf1c4570e0877e61f2fdc0bce8019492431d054d3d86925e5058dc5") add_versions("v1.2.11", "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff") add_versions("v1.2.12", "d8688496ea40fb61787500e863cc63c9afcbc524468cedeb478068924eb54932") @@ -73,13 +73,12 @@ package("zlib") add_defines("_LARGEFILE64_SOURCE=1") end ]]) - local configs = {} - if package:config("shared") then - configs.kind = "shared" - elseif not package:is_plat("windows", "mingw") and package:config("pic") ~= false then - configs.cxflags = "-fPIC" + import("package.tools.xmake").install(package) + + if package:config("shared") and package:is_plat("windows") then + package:add("defines", "ZLIB_DLL") end - import("package.tools.xmake").install(package, configs) + if package:config("zutil") then os.cp("zutil.h", package:installdir("include")) end