summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-11-23 13:45:37 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-03-10 19:05:19 +0530
commit5d15d65e26504b2188ffb42b2bf8a32e22a5add8 (patch)
treeea9f2d4335a23cb188fbb371c2b7c65bc1eefc61
parentc2b2a76b00ec0a994426509ccd6b9dedd077f19b (diff)
downloadgobject-introspection-5d15d65e26504b2188ffb42b2bf8a32e22a5add8.tar.gz
meson: Use glib_dep and configinc for girepository
glib_dep is what is actually needed to #include <glib.h>, not gobject_dep. It works incidentally with system gobject/glib but not when built via subprojects.
-rw-r--r--girepository/cmph/meson.build4
-rw-r--r--girepository/meson.build25
-rw-r--r--giscanner/meson.build8
-rw-r--r--meson.build4
4 files changed, 19 insertions, 22 deletions
diff --git a/girepository/cmph/meson.build b/girepository/cmph/meson.build
index 0c0e0af5..368afc7b 100644
--- a/girepository/cmph/meson.build
+++ b/girepository/cmph/meson.build
@@ -25,7 +25,7 @@ cmph_sources = [
]
cmph_deps = [
- gobject_dep,
+ glib_dep,
cc.find_library('m', required: false),
]
@@ -43,7 +43,7 @@ cmph_dep = declare_dependency(
cmph_test = executable('cmph-bdz-test', '../cmph-bdz-test.c',
dependencies: [
cmph_dep,
- gobject_dep,
+ glib_dep,
]
)
diff --git a/girepository/meson.build b/girepository/meson.build
index 53486241..b020caa4 100644
--- a/girepository/meson.build
+++ b/girepository/meson.build
@@ -2,16 +2,18 @@ subdir('cmph')
girepo_gthash_lib = static_library('girepository-gthash',
sources: 'gthash.c',
+ include_directories : configinc,
c_args: gi_hidden_visibility_cflags,
dependencies: [
cmph_dep,
- gobject_dep,
+ glib_dep,
+ gmodule_dep,
],
)
girepo_gthash_dep = declare_dependency(
link_with: girepo_gthash_lib,
- dependencies: gobject_dep,
+ dependencies: [glib_dep, gmodule_dep],
include_directories: include_directories('.'),
)
@@ -24,6 +26,7 @@ girepo_internals_lib = static_library('girepository-internals',
'girwriter.c',
],
c_args: gi_hidden_visibility_cflags,
+ include_directories : configinc,
dependencies: [girepo_gthash_dep, libffi_dep],
)
@@ -125,13 +128,10 @@ install_headers(girepo_headers, subdir: 'gobject-introspection-1.0')
girepo_lib = shared_library('girepository-1.0',
sources: girepo_sources,
+ include_directories : configinc,
c_args: gi_hidden_visibility_cflags + ['-DG_IREPOSITORY_COMPILATION'],
- dependencies: [
- gio_dep,
- gmodule_dep,
- girepo_internals_dep,
- dependency('gio-2.0'),
- ],
+ dependencies: [glib_dep, gobject_dep, gmodule_dep,
+ gio_dep, girepo_internals_dep],
version: '1.0.0',
install: true,
)
@@ -142,7 +142,7 @@ install_data('gdump.c',
girepo_dep = declare_dependency(
link_with: girepo_lib,
- dependencies: gio_dep,
+ dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep],
include_directories: include_directories('.'),
)
@@ -154,10 +154,5 @@ test('gthash-test', gthash_test)
if giounix_dep.found()
executable('gi-dump-types', 'gi-dump-types.c',
- dependencies: [
- girepo_dep,
- gmodule_dep,
- giounix_dep,
- ]
- )
+ dependencies: [girepo_dep, giounix_dep])
endif
diff --git a/giscanner/meson.build b/giscanner/meson.build
index 963fad59..e9a9c3cd 100644
--- a/giscanner/meson.build
+++ b/giscanner/meson.build
@@ -65,16 +65,14 @@ giscanner_lib = static_library('giscanner',
scannerlexer,
],
c_args: giscanner_args,
- dependencies: gio_dep,
+ dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep],
)
# TODO: -export-symbols-regex "init_giscanner|PyInit__giscanner"
giscanner_pymod = py3.extension_module('_giscanner', 'giscannermodule.c',
link_with: giscanner_lib,
- dependencies: [
- gobject_dep,
- dependency('python3'),
- ],
+ dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep,
+ dependency('python3')],
install: true,
install_dir: giscannerdir,
)
diff --git a/meson.build b/meson.build
index b117dd15..0fb029ab 100644
--- a/meson.build
+++ b/meson.build
@@ -10,6 +10,8 @@ project('gobject-introspection', 'c',
host_system = host_machine.system()
gi_versions = meson.project_version().split('.')
+configinc = include_directories('.')
+
py3 = import('python3')
cc = meson.get_compiler('c')
@@ -52,6 +54,8 @@ endif
# Always bumped to match our version
glib_version = '>=2.@0@.@1@'.format(gi_versions[1], gi_versions[2])
+glib_dep = dependency('glib-2.0', version : glib_version,
+ fallback: ['glib', 'libglib_dep'])
gobject_dep = dependency('gobject-2.0', version : glib_version,
fallback: ['glib', 'libgobject_dep'])
gio_dep = dependency('gio-2.0', version : glib_version,