xlsxio: fix wchar config (#2985)

* xlsxio: fix wchar config

* improve minizip includedirs

* fix deps
pull/2987/head
star9029 11 months ago committed by GitHub
parent e88484a82a
commit 15b61bf02c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      packages/e/expat/xmake.lua
  2. 4
      packages/m/minizip/xmake.lua
  3. 4
      packages/x/xlsxio/port/xmake.lua
  4. 10
      packages/x/xlsxio/xmake.lua

@ -14,6 +14,8 @@ package("expat")
add_versions("2.2.10", "b2c160f1b60e92da69de8e12333096aeb0c3bf692d41c60794de278af72135a5")
add_versions("2.2.6", "17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2")
add_configs("char_type", {description = "Character type to use", default = "char", type = "string", values = {"char", "ushort", "wchar_t"}})
add_deps("cmake")
on_load("windows", function (package)
if not package:config("shared") then
@ -25,6 +27,7 @@ package("expat")
local configs = {"-DEXPAT_BUILD_EXAMPLES=OFF", "-DEXPAT_BUILD_TESTS=OFF", "-DEXPAT_BUILD_DOCS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DEXPAT_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DEXPAT_CHAR_TYPE=" .. package:config("char_type"))
if package:is_plat("windows") then
table.insert(configs, "-DEXPAT_MSVC_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
end

@ -12,6 +12,8 @@ package("minizip")
add_deps("zlib")
add_includedirs("include", "include/minizip")
on_install(function (package)
os.cd(path.join("contrib", "minizip"))
io.writefile("xmake.lua", [[
@ -22,7 +24,7 @@ package("minizip")
target("minizip")
set_kind("$(kind)")
add_files("zip.c", "unzip.c", "mztools.c", "ioapi.c")
add_headerfiles("crypt.h", "zip.h", "unzip.h", "ioapi.h", "mztools.h")
add_headerfiles("crypt.h", "zip.h", "unzip.h", "ioapi.h", "mztools.h", {prefixdir = "minizip"})
add_packages("zlib")
if is_plat("windows") then
add_files("iowin32.c")

@ -6,7 +6,11 @@ option("wide", {showmenu = true, default = false})
add_rules("mode.debug", "mode.release")
if has_config("wide") then
add_requires("expat", {configs = {char_type = "wchar_t"}})
else
add_requires("expat")
end
if has_config("libzip") then
add_requires("libzip")

@ -16,8 +16,6 @@ package("xlsxio")
add_syslinks("pthread")
end
add_deps("expat")
on_load(function (package)
if package:config("libzip") then
package:add("deps", "libzip")
@ -26,6 +24,12 @@ package("xlsxio")
else
package:add("deps", "minizip")
end
if package:config("wide") then
package:add("deps", "expat", {configs = {char_type = "wchar_t"}})
else
package:add("deps", "expat")
end
end)
on_install("windows", "linux", "macosx", "mingw", "cross", function (package)
@ -41,8 +45,6 @@ package("xlsxio")
end
package:add("defines", "BUILD_XLSXIO_" .. (package:config("shared") and "SHARED" or "STATIC"))
io.replace("lib/xlsxio_read.c", "minizip/", "", {plain = true})
io.replace("lib/xlsxio_write.c", "minizip/", "", {plain = true})
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
import("package.tools.xmake").install(package, configs)
end)

Loading…
Cancel
Save