Fix meson build on macos

This commit is contained in:
Oleksii Samorukov 2020-01-18 23:38:26 +01:00
parent d24713349d
commit 5d0b0ad467
4 changed files with 19 additions and 3 deletions

View File

@ -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,
)

View File

@ -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',

View File

@ -1,3 +1,6 @@
if platform_osx
add_project_arguments('-ObjC', language : 'c')
endif
gimpversion = configure_file(
input : 'gimpversion.h.in',

View File

@ -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