[gtk/gtk-3-24-meson: 14/95] meson: Build fixes for macOS



commit 89d5c543accd910fc00e604c328cc7a1e72d476f
Author: Philippe Normand <phil base-art net>
Date:   Sun Nov 25 17:25:32 2018 +0000

    meson: Build fixes for macOS

 gdk/meson.build        |  3 +++
 gdk/quartz/meson.build | 12 +++++++++---
 gtk/meson.build        |  2 +-
 meson.build            |  2 +-
 4 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/gdk/meson.build b/gdk/meson.build
index e9e7b8a819..6a75a9fed5 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -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
 
diff --git a/gdk/quartz/meson.build b/gdk/quartz/meson.build
index 8c1b8d1795..1f137d18f8 100644
--- a/gdk/quartz/meson.build
+++ b/gdk/quartz/meson.build
@@ -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,
diff --git a/gtk/meson.build b/gtk/meson.build
index 9526c049f7..b527f136f0 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -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
diff --git a/meson.build b/meson.build
index 94ed7e155a..06cf577d47 100644
--- a/meson.build
+++ b/meson.build
@@ -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
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]