Meson: Fix cocoa and carbon support

- Compiler checks were failing because it were using C compiler to build
objc code.
- xdgmime is needed on osx too.
- -DGIO_COMPILATION must be passed to objc compiler too.
- gapplication doesn't build on osx, it is excluded in autotools too.

We have to be careful when we use add_project_link_arguments(): All
targets are built using link arguments for the C language, except for
libgio on osx which use the objc language, because it contains some ".m"
source files. See https://github.com/mesonbuild/meson/issues/3585.

https://bugzilla.gnome.org/show_bug.cgi?id=796214
This commit is contained in:
Xavier Claessens
2018-05-17 14:32:23 -04:00
parent e400af99d4
commit 2e3769a4f7
2 changed files with 44 additions and 30 deletions

View File

@@ -417,10 +417,11 @@ if host_system != 'windows'
contenttype_sources += files('gcontenttype.c')
appinfo_sources += files('gdesktopappinfo.c')
gio_unix_include_headers += files('gdesktopappinfo.h')
subdir('xdgmime')
internal_deps += [xdgmime_lib]
endif
subdir('xdgmime')
internal_deps += [xdgmime_lib]
install_headers(gio_unix_include_headers, subdir : 'gio-unix-2.0/gio')
if glib_conf.has('HAVE_NETLINK')
@@ -794,6 +795,7 @@ libgio = library('gio-2.0',
libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep,
platform_deps, network_libs],
c_args : gio_c_args,
objc_args : gio_c_args,
# intl.lib is not compatible with SAFESEH
link_args : [noseh_link_args, glib_link_flags],
)
@@ -939,7 +941,7 @@ executable('gdbus', 'gdbus-tool.c',
link_args : noseh_link_args,
dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
if host_system != 'windows'
if host_system != 'windows' and not glib_have_cocoa
executable('gapplication', 'gapplication-tool.c',
install : true,
c_args : gio_c_args,