@@ -48,6 +48,12 @@ package("libxml2")
4848 end
4949
5050 on_load (function (package )
51+ if true then -- package:is_plat("windows", "mingw", "macosx", "linux")
52+ package :config_set (" lzma" , true )
53+ end
54+ if not package :is_plat (" wasm" , " iphoneos" , " android" ) or (package :is_plat (" android" ) and not is_subhost (" windows" )) then
55+ package :config_set (" icu" , true )
56+ end
5157 if package :config (" all" ) then
5258 for name , _ in pairs (import (" configs" ).get_libxml2_configs ()) do
5359 if name ~= " python" then
@@ -77,7 +83,7 @@ package("libxml2")
7783 package :add (" deps" , " libiconv" )
7884 end
7985 if package :config (" icu" ) then
80- package :add (" deps" , " icu4c" )
86+ package :add (" deps" , " icu4c" , { configs = { shared = package : config ( " shared " )}} )
8187 end
8288 if package :config (" lzma" ) then
8389 package :add (" deps" , " xz" )
@@ -140,9 +146,9 @@ package("libxml2")
140146 table.insert (cxflags , " -DLZMA_API_STATIC" )
141147 end
142148 import (" package.tools.cmake" )
143- local envs = cmake .buildenvs (package , {cxflags = cxflags , shflags = shflags })
149+ local envs = cmake .buildenvs (package , {cxflags = cxflags , shflags = shflags , packagedeps = { " libiconv " } })
144150 utils .dump (envs )
145- cmake .install (package , configs , {cxflags = cxflags , shflags = shflags })
151+ cmake .install (package , configs , {envs = envs })
146152
147153 if package :is_plat (" windows" ) then
148154 local libfiles = os.files (package :installdir (" lib/*xml2*.lib" ))[1 ]
0 commit comments