build: Don't hardcode shared_library() in meson.

Instead, use the standard library().
This is a meson best practice.

Fixes #2248.

Fixes -Ddefault_library=static not having any effect.

Cherry-Picked-From: bb9c07d8fe
This commit is contained in:
Niklas Hambüchen 2019-11-11 16:37:46 +01:00
parent 75475effb1
commit d5457d1b14
4 changed files with 40 additions and 40 deletions

View File

@ -286,20 +286,20 @@ if cc.get_id() == 'msvc'
gdk_link_args += [ '-export:gdk_win32_display_manager_get_type' ]
endif
libgdk = shared_library('gdk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
dependencies: gdk_deps,
include_directories: [confinc, gdkx11_inc, wlinc],
c_args: [
'-DGDK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_whole: gdk_backends,
link_args: gdk_link_args,
darwin_versions : gtk_osxversions,
install: true)
libgdk = library('gdk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
dependencies: gdk_deps,
include_directories: [confinc, gdkx11_inc, wlinc],
c_args: [
'-DGDK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_whole: gdk_backends,
link_args: gdk_link_args,
darwin_versions : gtk_osxversions,
install: true)
gdk_dep_sources = [gdkconfig, gdkenum_h]
# Introspection

View File

@ -964,17 +964,17 @@ foreach l: immodules
endforeach
# Library
libgtk = shared_library('gtk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
c_args: gtk_cargs + common_cflags,
include_directories: [confinc, gdkinc, gtkinc],
dependencies: gtk_deps + [libgdk_dep] + gtk_included_im_deps,
link_with: libgdk,
link_args: common_ldflags,
darwin_versions : gtk_osxversions,
install: true)
libgtk = library('gtk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
c_args: gtk_cargs + common_cflags,
include_directories: [confinc, gdkinc, gtkinc],
dependencies: gtk_deps + [libgdk_dep] + gtk_included_im_deps,
link_with: libgdk,
link_args: common_ldflags,
darwin_versions : gtk_osxversions,
install: true)
# Introspection
if build_gir

View File

@ -17,16 +17,16 @@ if cc.get_id() == 'msvc'
gailutil_link_args += '-def:@0@/gailutil.def'.format(meson.current_source_dir())
endif
libgailutil = shared_library('gailutil-3',
soversion: gtk_soversion,
version: gail_library_version,
darwin_versions: ['1', '1.0'],
sources: [gailutil_sources],
dependencies: libgtk_dep,
include_directories: [confinc, gtkinc],
c_args: [
'-DGDK_DISABLE_DEPRECATED',
'-DGTK_DISABLE_DEPRECATED',
] + common_cflags,
link_args: gailutil_link_args,
install: true)
libgailutil = library('gailutil-3',
soversion: gtk_soversion,
version: gail_library_version,
darwin_versions: ['1', '1.0'],
sources: [gailutil_sources],
dependencies: libgtk_dep,
include_directories: [confinc, gtkinc],
c_args: [
'-DGDK_DISABLE_DEPRECATED',
'-DGTK_DISABLE_DEPRECATED',
] + common_cflags,
link_args: gailutil_link_args,
install: true)

View File

@ -1,6 +1,6 @@
testexecdir = join_paths(installed_test_bindir, 'reftests')
libgtkreftestprivate = shared_library('gtkreftestprivate', [
libgtkreftestprivate = library('gtkreftestprivate', [
'reftest-compare.c',
'reftest-module.c',
'reftest-snapshot.c'],
@ -483,4 +483,4 @@ if get_option('installed_tests')
endforeach
install_data(test_data, install_dir: testexecdir)
endif
endif