@@ -250,8 +250,10 @@ libmsi_dep = declare_dependency(
250250 dependencies : libmsi_deps,
251251)
252252
253- # --- libeconf (static, built from source — needed on Linux for libblkid) ---
253+ # --- Platform-specific dependencies and link args ---
254254platform_link_deps = []
255+ platform_extra_deps = []
256+
255257if host_machine .system() == ' linux'
256258 libeconf = static_library (' econf' ,
257259 ' libeconf/lib/econf_error.c' ,
@@ -266,17 +268,20 @@ if host_machine.system() == 'linux'
266268 include_directories : include_directories (' libeconf/include' , ' libeconf/lib' ),
267269 )
268270 platform_link_deps = [libeconf]
269- endif
270-
271- # --- Platform-specific link args ---
272- if host_machine .system() == ' windows'
271+ platform_link_args = [' -static' ]
272+ elif host_machine .system() == ' darwin'
273+ platform_link_args = [
274+ ' -framework' , ' CoreFoundation' ,
275+ ' -framework' , ' Foundation' ,
276+ ' -framework' , ' AppKit' ,
277+ ' -framework' , ' Carbon' ,
278+ ]
279+ elif host_machine .system() == ' windows'
273280 platform_link_args = [
274281 ' -lws2_32' , ' -lole32' , ' -lshell32' , ' -lshlwapi' ,
275282 ' -ladvapi32' , ' -luserenv' , ' -liphlpapi' , ' -ldnsapi' ,
276283 ' -lbcrypt' ,
277284 ]
278- elif host_machine .system() == ' linux'
279- platform_link_args = [' -static' ]
280285else
281286 platform_link_args = []
282287endif
@@ -320,7 +325,7 @@ wixl = executable('wixl',
320325 c_args : [' -include' , meson .project_build_root() / ' config.h' ],
321326 include_directories : [inc_dirs, gcab_inc_dirs],
322327 link_with : [libcommon] + platform_link_deps,
323- dependencies : [libmsi_dep, libgcab_dep, glib, gio, libxml],
328+ dependencies : [libmsi_dep, libgcab_dep, glib, gio, libxml] + platform_extra_deps ,
324329 link_args : platform_link_args,
325330 install : true ,
326331)
0 commit comments