From 64ac9d7a37986eef404914b66e220e0ea530b845 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 3 Aug 2017 18:05:12 +0800 Subject: build: Add Meson build option for relocatable builds Add an option for relocatable builds, which is always enabled for Windows builds as the GDK-Pixbuf DLLs can be moved about depending on the packaging of the app. This is done as an option as relocatability is supported on non-Windows platforms as well. https://bugzilla.gnome.org/show_bug.cgi?id=785767 --- meson.build | 12 ++++++++++++ meson_options.txt | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/meson.build b/meson.build index b95eb9ffb..7daa4ce67 100644 --- a/meson.build +++ b/meson.build @@ -251,6 +251,18 @@ if get_option('enable_jasper') endif endif +# Determine whether we enable application bundle relocation support, and we use +# this always on Windows +if host_system == 'windows' + relocatable = true +else + relocatable = get_option('enable_relocatable') +endif + +if relocatable + add_project_arguments([ '-DGDK_PIXBUF_RELOCATABLE' ], language: 'c') +endif + gdk_pixbuf_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) configure_file(output: 'config.h', configuration: gdk_pixbuf_conf) diff --git a/meson_options.txt b/meson_options.txt index 0006cd75c..1c761dbeb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,3 +30,7 @@ option('with_man', description: 'Whether to generate man pages (requires xlstproc)', type: 'boolean', value: true) +option('enable_relocatable', + description: 'Whether to enable application bundle relocation support', + type: 'boolean', + value: false) -- cgit v1.2.1