[tepl/master.msvc: 7/7] meson: Add option to disable introspection



commit 6f45a1fd70952b12cf2b467c09975dadbad2efcc
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Jul 14 15:10:15 2020 +0800

    meson: Add option to disable introspection
    
    There are cases where one might need to disable introspection builds, such as
    when performing a cross-compilation where the generated binaries could not be
    run on the build system

 meson_options.txt |  5 +++++
 tepl/meson.build  | 38 ++++++++++++++++++++------------------
 2 files changed, 25 insertions(+), 18 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index cad97dd..01a354b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,3 +3,8 @@ option(
   type: 'boolean', value: false,
   description: 'Build API reference (requires gtk-doc)'
 )
+option(
+  'gir',
+  type: 'boolean', value: true,
+  description: 'Build introspection files (requires gobject-introspection)'
+)
diff --git a/tepl/meson.build b/tepl/meson.build
index 93ca1c5..9b75150 100644
--- a/tepl/meson.build
+++ b/tepl/meson.build
@@ -166,21 +166,23 @@ PKG_CONFIG.generate(tepl_lib,
   libraries: TEPL_PUBLIC_DEPS,
 )
 
-GNOME.generate_gir(
-  tepl_lib,
-  export_packages: 'tepl-@0@'.format(TEPL_API_VERSION),
-  header: 'tepl/tepl.h',
-  identifier_prefix: 'Tepl',
-  include_directories: ROOT_INCLUDE_DIR,
-  includes: ['Gtk-3.0', 'GtkSource-4', 'Amtk-5'],
-  install: true,
-  namespace: 'Tepl',
-  nsversion: TEPL_API_VERSION,
-  sources: [
-    tepl_public_headers,
-    tepl_public_c_files,
-    tepl_enum_types
-  ],
-  # Support for deps being built as subprojects:
-  dependencies: TEPL_DEPS,
-)
+if get_option('gir')
+  GNOME.generate_gir(
+    tepl_lib,
+    export_packages: 'tepl-@0@'.format(TEPL_API_VERSION),
+    header: 'tepl/tepl.h',
+    identifier_prefix: 'Tepl',
+    include_directories: ROOT_INCLUDE_DIR,
+    includes: ['Gtk-3.0', 'GtkSource-4', 'Amtk-5'],
+    install: true,
+    namespace: 'Tepl',
+    nsversion: TEPL_API_VERSION,
+    sources: [
+      tepl_public_headers,
+      tepl_public_c_files,
+      tepl_enum_types
+    ],
+    # Support for deps being built as subprojects:
+    dependencies: TEPL_DEPS,
+  )
+endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]