diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2017-04-18 14:51:25 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-05-03 15:10:56 +0100 |
commit | 482f34006e6c9709a2f5a219ab6bcc5ff70e1aa0 (patch) | |
tree | 80e1a2e5a0cd214661b24186f02c0df1894de7a4 /meson.build | |
parent | 47bcf66af8fa0f545b22c389fd712acb5d29f100 (diff) | |
download | gtk+-482f34006e6c9709a2f5a219ab6bcc5ff70e1aa0.tar.gz |
build: Use the appropriate linker flags
We need to check if the linker flags we use are available, depending on
the platform, and we need to ensure that the shared library is
versioned appropriately.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 34ba0fb59c..da5505ef27 100644 --- a/meson.build +++ b/meson.build @@ -68,6 +68,8 @@ gtk_binary_version = '4.0.0' gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version +gtk_soversion = '0.@0@.@1@'.format(gtk_binary_age - gtk_interface_age, gtk_interface_age) + gtk_api_version = '4.0' x11_enabled = get_option('enable-x11-backend') @@ -272,6 +274,21 @@ if get_option('default_library') != 'static' endif endif +common_ldflags = [] + +if host_machine.system() == 'linux' + foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] + if cc.has_argument(ldflag) + common_ldflags += [ ldflag ] + endif + endforeach +endif + +# Maintain compatibility with autotools +if host_machine.system() == 'darwin' + common_ldflags += [ '-compatibility_version=1', '-current_version=1.0', ] +endif + confinc = include_directories('.') gdkinc = include_directories('gdk') gtkinc = include_directories('gtk') |