meson: Build fixes for macOS

This commit is contained in:
Philippe Normand 2018-11-25 17:25:32 +00:00 committed by Christoph Reiter
parent cde5a3f4b4
commit 89d5c543ac
4 changed files with 14 additions and 5 deletions

View File

@ -249,6 +249,9 @@ foreach backend : ['broadway', 'quartz', 'wayland', 'win32', 'x11']
if backend == 'wayland'
gdk_backends_gen_headers += get_variable('gdk_@0@_gen_headers'.format(backend))
endif
if backend == 'quartz'
common_cflags += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c']
endif
endif
endforeach

View File

@ -1,4 +1,6 @@
# FIXME: do we need to do an add_language() for objective-c here?
add_languages(['objc'])
gdk_quartz_sources = files(
'GdkQuartzView.c',
'GdkQuartzNSWindow.c',
@ -41,8 +43,12 @@ gdk_quartz_public_headers = files(
install_headers(gdk_quartz_public_headers, subdir: 'gtk-3.0/gdk/quartz')
install_headers('gdkquartz.h', subdir: 'gtk-3.0/gdk')
gdk_quartz_deps = [ # FIXME
]
core_graphics_dep = dependency('appleframeworks', modules : 'CoreGraphics', required : true)
appkit_dep = dependency('appleframeworks', modules : 'AppKit', required : true)
cocoa_dep = dependency('appleframeworks', modules : 'Cocoa', required : true)
carbon_dep = dependency('appleframeworks', modules : 'Carbon', required : true)
gdk_quartz_deps = [ core_graphics_dep, appkit_dep, cocoa_dep, carbon_dep ]
libgdk_quartz = static_library('gdk-quartz',
gdk_quartz_sources, gdkconfig, gdkenum_h,

View File

@ -846,7 +846,7 @@ endif
if quartz_enabled
gtk_sources += gtk_use_quartz_sources
gtk_cargs += ['-xobjective-c'] # FIXME? maybe add_languages() instead?
gtk_cargs += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c'] # FIXME? maybe add_languages() instead?
endif
# So we don't add these twice

View File

@ -505,7 +505,7 @@ if broadway_enabled
endif
if quartz_enabled
pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon']
pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon', '-framework CoreGraphics']
backend_immodules += ['quartz']
endif