mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-27 12:46:02 +01:00
Fix meson dependency for MacOSX
This commit is contained in:
parent
2315f45eea
commit
38ac9bd4d1
3 changed files with 26 additions and 27 deletions
18
meson.build
18
meson.build
|
@ -44,9 +44,15 @@ gthread = dependency('gthread-2.0', version: '>=2.50')
|
|||
gmodule = dependency('gmodule-no-export-2.0', version: '>=2.50')
|
||||
gtk3 = dependency('gtk+-3.0', version: '>=3.22')
|
||||
cairo = dependency('cairo')
|
||||
gtk_mac_integration = dependency('gtk-mac-integration-gtk3')
|
||||
|
||||
build_dependencies = [libm, girara, glib, gio, gthread, gmodule, gtk3, cairo, gtk_mac_integration]
|
||||
build_dependencies = [libm, girara, glib, gio, gthread, gmodule, gtk3, cairo]
|
||||
|
||||
if host_machine.system() == 'darwin'
|
||||
gtk_mac_integration = dependency('gtk-mac-integration-gtk3')
|
||||
build_dependencies += gtk_mac_integration
|
||||
conf_data.set('GTKOSXAPPLICATION', true)
|
||||
endif
|
||||
|
||||
|
||||
# defines
|
||||
defines = [
|
||||
|
@ -105,6 +111,13 @@ version_header = configure_file(
|
|||
output: 'zathura-version.h',
|
||||
configuration: conf_data
|
||||
)
|
||||
|
||||
os_dependency_header = configure_file(
|
||||
input: 'zathura/os-dependency.h.in',
|
||||
output: 'zathura-os-dependency.h',
|
||||
configuration: conf_data
|
||||
)
|
||||
|
||||
include_directories = [
|
||||
include_directories('.')
|
||||
]
|
||||
|
@ -157,6 +170,7 @@ headers = files(
|
|||
'zathura/types.h',
|
||||
)
|
||||
headers += version_header
|
||||
headers += os_dependency_header
|
||||
|
||||
# zathura helper library
|
||||
libzathura = static_library('zathura',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SPDX-License-Identifier: Zlib */
|
||||
|
||||
#include <gtkosxapplication.h>
|
||||
#include "zathura-os-dependency.h"
|
||||
#include <girara/settings.h>
|
||||
#include <girara/log.h>
|
||||
|
||||
|
@ -20,23 +20,6 @@
|
|||
#include "synctex.h"
|
||||
#endif
|
||||
|
||||
/* Uncomment ONE of these to test menu-mangling: */
|
||||
//#define GTKMACINTEGRATION
|
||||
#define GTKOSXAPPLICATION
|
||||
|
||||
/* These others are optional */
|
||||
#define GTK_DISABLE_DEPRECATION_WARNINGS 1
|
||||
#define BUILT_UI //The built UI uses deprecated functions
|
||||
//#define QUARTZ_HANDLERS
|
||||
|
||||
/* GTKMACINTEGRATION uses Carbon, which isn't available for 64-bit builds. */
|
||||
#ifdef __x86_64__
|
||||
#undef GTKMACINTEGRATION
|
||||
# ifndef GTKOSXAPPLICATION
|
||||
#define GTKOSXAPPLICATION
|
||||
# endif
|
||||
#endif //__x86_64__
|
||||
|
||||
/* Init locale */
|
||||
static void
|
||||
init_locale(void)
|
||||
|
@ -320,15 +303,8 @@ main(int argc, char* argv[])
|
|||
|
||||
#ifdef GTKOSXAPPLICATION
|
||||
GtkosxApplication *zathuraApp;
|
||||
#endif //GTKOSXAPPLICATION
|
||||
zathuraApp = g_object_new (GTKOSX_TYPE_APPLICATION, NULL);
|
||||
{
|
||||
gboolean falseval = FALSE;
|
||||
gboolean trueval = TRUE;
|
||||
}
|
||||
# ifndef QUARTZ_HANDLERS
|
||||
gtkosx_application_set_use_quartz_accelerators (zathuraApp, FALSE);
|
||||
# endif //QUARTZ_HANDLERS
|
||||
gtkosx_application_ready (zathuraApp);
|
||||
{
|
||||
const gchar *id = gtkosx_application_get_bundle_id ();
|
||||
|
@ -337,6 +313,7 @@ main(int argc, char* argv[])
|
|||
g_print ("TestIntegration Error! Bundle Has ID %s\n", id);
|
||||
}
|
||||
}
|
||||
#endif //GTKOSXAPPLICATION
|
||||
/* run zathura */
|
||||
gtk_main();
|
||||
|
||||
|
|
8
zathura/os-dependency.h.in
Normal file
8
zathura/os-dependency.h.in
Normal file
|
@ -0,0 +1,8 @@
|
|||
/* SPDX-License-Identifier: Zlib */
|
||||
|
||||
#mesondefine GTKOSXAPPLICATION
|
||||
|
||||
#ifdef GTKOSXAPPLICATION
|
||||
#include <gtkosxapplication.h>
|
||||
#endif
|
||||
|
Loading…
Reference in a new issue