[gimp] Fix meson build on macos



commit 5d0b0ad4675fdd7fe057f2281935b315c9dc2cab
Author: Oleksii Samorukov <samm os2 kiev ua>
Date:   Sat Jan 18 23:38:26 2020 +0100

    Fix meson build on macos

 app/gui/meson.build     |  2 +-
 app/meson.build         |  3 +++
 libgimpbase/meson.build |  3 +++
 meson.build             | 14 ++++++++++++--
 4 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/app/gui/meson.build b/app/gui/meson.build
index 61d428edf7..d128d3101f 100644
--- a/app/gui/meson.build
+++ b/app/gui/meson.build
@@ -29,7 +29,7 @@ libappgui = static_library('appgui',
   include_directories: [ rootInclude, rootAppInclude, ],
   c_args: '-DG_LOG_DOMAIN="Gimp-GUI"',
   dependencies: [
-    cairo, gegl, gdk_pixbuf, gio_specific, gtk3
+    cairo, gegl, gdk_pixbuf, gio_specific, gtk3, gtk3_macos
   ],
   install: false,
 )
diff --git a/app/meson.build b/app/meson.build
index 68a32ed2c6..b1edca0ae3 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -180,6 +180,9 @@ else
   link_args = []
 endif
 
+if platform_osx
+  link_args += osx_ldflags
+endif
 
 gimpconsole_exe = executable('gimp-console-'+gimp_app_version,
   'main.c',
diff --git a/libgimpbase/meson.build b/libgimpbase/meson.build
index 5e1fcfc734..a688785df2 100644
--- a/libgimpbase/meson.build
+++ b/libgimpbase/meson.build
@@ -1,3 +1,6 @@
+if platform_osx
+  add_project_arguments('-ObjC', language : 'c')
+endif
 
 gimpversion = configure_file(
   input : 'gimpversion.h.in',
diff --git a/meson.build b/meson.build
index 8abacd62be..61ac501ac0 100644
--- a/meson.build
+++ b/meson.build
@@ -143,7 +143,9 @@ platform_osx = (
   host_os.contains('darwin')
 )
 
-conf.set('PLATFORM_OSX', platform_osx)
+if platform_osx
+  conf.set('PLATFORM_OSX', 1)
+endif
 
 if platform_windows
   windows = import('windows')
@@ -152,6 +154,14 @@ if platform_windows
   # compiler_args += '-Wl,--large-address-aware'
 endif
 
+# on OSX ObjC and C sources are mixed so adding objc to the linkflags
+
+osx_ldflags = []
+if platform_osx
+  add_languages('objc')
+  osx_ldflags += ['-Wl,-framework,Foundation', '-Wl,-framework,AppKit', '-ObjC']
+  add_project_link_arguments(osx_ldflags, language : ['objc', 'c'])
+endif
 
 if cc.get_id() == 'gcc' and cc.version() == '7.2.0'
   gcc_warning = '''
@@ -1030,7 +1040,7 @@ endif
 
 
 # Check for GTK Mac Integration
-if platform_osx and (gtk3.get_pkgconfig_variable('targets').contains('xquartz'))
+if platform_osx and (gtk3.get_pkgconfig_variable('targets').contains('quartz'))
   gtk3_macos = dependency('gtk-mac-integration', version: '>=2.0.0')
 else
   gtk3_macos = no_dep


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