Add zlib and bzip2 support to boost iostreams (#4880)

#4866
pull/4893/head
Yassine Sen 4 months ago committed by GitHub
parent 7afcf42903
commit 3a79d28c5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      packages/b/boost/xmake.lua

@ -84,6 +84,8 @@ package("boost")
end end
add_configs("zstd", {description = "enable zstd for iostreams", default = false, type = "boolean"}) add_configs("zstd", {description = "enable zstd for iostreams", default = false, type = "boolean"})
add_configs("lzma", {description = "enable lzma for iostreams", default = false, type = "boolean"}) add_configs("lzma", {description = "enable lzma for iostreams", default = false, type = "boolean"})
add_configs("zlib", {description = "enable zlib for iostreams", default = false, type = "boolean"})
add_configs("bzip2", {description = "enable bzip2 for iostreams", default = false, type = "boolean"})
on_load(function (package) on_load(function (package)
@ -151,6 +153,12 @@ package("boost")
if package:config("lzma") then if package:config("lzma") then
package:add("deps", "xz") package:add("deps", "xz")
end end
if package:config("zlib") then
package:add("deps", "zlib")
end
if package:config("bzip2") then
package:add("deps", "bzip2")
end
if package:is_plat("windows") and package:version():le("1.85.0") then if package:is_plat("windows") and package:version():le("1.85.0") then
local vs_toolset = package:toolchain("msvc"):config("vs_toolset") local vs_toolset = package:toolchain("msvc"):config("vs_toolset")
@ -289,6 +297,12 @@ package("boost")
if package:config("zstd") then if package:config("zstd") then
config_deppath(file, "zstd", "zstd") config_deppath(file, "zstd", "zstd")
end end
if package:config("zlib") then
config_deppath(file, "zlib", "zlib")
end
if package:config("bzip2") then
config_deppath(file, "bzip2", "bzip2")
end
file:close() file:close()
end end
os.vrun("./b2 headers") os.vrun("./b2 headers")
@ -323,6 +337,12 @@ package("boost")
if not package:config("zstd") then if not package:config("zstd") then
table.insert(argv, "-sNO_ZSTD=1") table.insert(argv, "-sNO_ZSTD=1")
end end
if not package:config("zlib") then
table.insert(argv, "-sNO_ZLIB=1")
end
if not package:config("bzip2") then
table.insert(argv, "-sNO_BZIP2=1")
end
if package:config("lto") then if package:config("lto") then
table.insert(argv, "lto=on") table.insert(argv, "lto=on")

Loading…
Cancel
Save