summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Espinosa <esodan@gmail.com>2017-11-22 18:03:21 -0600
committerRico Tzschichholz <ricotz@ubuntu.com>2022-02-21 13:56:21 +0100
commit6104fd8284b53d58d040a43e9d4910286b06e4b4 (patch)
treefaec25d44aa33c55dff6ace315f9fa5eb2d4569a
parent5e07594b1630c220ebbaefbdc3b8642dab5237cd (diff)
downloadlibgee-6104fd8284b53d58d040a43e9d4910286b06e4b4.tar.gz
Added infrastructure to disable introspectionmeson
As for Meson 0.43.0, no way to prevent a generated GIR file to be installed in the system, even if disable-introspection=true is set. May this is not an issue as libgee generates header, VAPI and GIR, all of them needed when developing. Just in case g-ir-compiler is not found no typelib is generated and so introspection is incomplete any way. g-ir-compiler is installed with gobject-introspection package in almost all distributions.
-rw-r--r--gee/meson.build39
-rw-r--r--meson_options.txt1
2 files changed, 27 insertions, 13 deletions
diff --git a/gee/meson.build b/gee/meson.build
index 6faaaf2..63b736f 100644
--- a/gee/meson.build
+++ b/gee/meson.build
@@ -105,6 +105,14 @@ if enable_consistency_check_opt
enable_consistency_check_args += ['-D','CONSISTENCY_CHECKS']
endif
+# Can't prevent install generated GIR file
+disable_introspection = get_option('disable-introspection')
+introspectiondir=false
+if disable_introspection
+else
+introspectiondir = join_paths (get_option('includedir'),'gee-@0@'.format (API_VERSION))
+endif
+
gee = library('gee-@0@'.format(API_VERSION),
valasources + sources,
version : PROJECT_VERSION,
@@ -116,20 +124,25 @@ gee = library('gee-@0@'.format(API_VERSION),
install : true,
install_dir : [
get_option('libdir'),
- join_paths (get_option('includedir'),'gee-@0@'.format (API_VERSION)),
+ introspectiondir,
true,
true,
])
-g_ir_compiler = find_program('g-ir-compiler')
-custom_target('typelib',
- command: [
- g_ir_compiler,
- '--shared-library', 'libgee-@0@.so'.format (API_VERSION),
- '--output', '@OUTPUT@',
- join_paths(meson.current_build_dir(), 'Gee-@0@.gir'.format(API_VERSION))
- ],
- output: 'Gee-@0@.typelib'.format(API_VERSION),
- depends: gee,
- install: true,
- install_dir: join_paths(get_option('libdir'), 'girepository-1.0'))
+if disable_introspection
+else
+ g_ir_compiler = find_program('g-ir-compiler', required: false)
+ if g_ir_compiler.found()
+ custom_target('typelib',
+ command: [
+ g_ir_compiler,
+ '--shared-library', 'libgee-@0@.so'.format (API_VERSION),
+ '--output', '@OUTPUT@',
+ join_paths(meson.current_build_dir(), 'Gee-@0@.gir'.format(API_VERSION))
+ ],
+ output: 'Gee-@0@.typelib'.format(API_VERSION),
+ depends: gee,
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'girepository-1.0'))
+ endif
+endif
diff --git a/meson_options.txt b/meson_options.txt
index 70d5cda..3dae714 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,3 +2,4 @@ option('enable-benchmark', type : 'boolean', value : false, description : 'Enabl
option('disable-internal-asserts', type : 'boolean', value : false, description : 'Disables the internal asserts')
option('enable-consistency-check', type : 'boolean', value : false, description : 'Enables (very) expensive consistency checks. It might affect the asymptotic performance.')
option('enable-doc', type : 'boolean', value : false, description : 'Enable documentation generation')
+option('disable-introspection', type : 'boolean', value : false, description : 'Disable introspection generation')