summaryrefslogtreecommitdiff
path: root/dev-libs/libgweather/files/40.0-meson-tweaks.patch
blob: aa56c592890fd9e6c68e6a4a826676824578fb3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
From bbf17eac53c128904190ef2d74176b0717d7d907 Mon Sep 17 00:00:00 2001
From: Mart Raudsepp <leio@gentoo.org>
Date: Sat, 23 Feb 2019 12:21:01 +0200
Subject: [PATCH] build: Provide introspection option and don't build manual
 tests

---
 libgweather/meson.build | 21 ++++++++++++++-------
 meson.build             |  4 ++++
 meson_options.txt       |  2 ++
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/libgweather/meson.build b/libgweather/meson.build
index 26f067e6..8f0f9047 100644
--- a/libgweather/meson.build
+++ b/libgweather/meson.build
@@ -74,6 +74,15 @@ lib_libgweather = shared_library('gweather-3',
   install: true,
 )
 
+libgweather_dep = declare_dependency(
+  sources: [gweather_enum_types[1]],
+  dependencies: deps_libgweather,
+  link_with: lib_libgweather,
+  include_directories: root_inc,
+)
+
+if get_option('introspection')
+
 gweather_gir = gnome.generate_gir(lib_libgweather,
   sources: introspection_sources,
   dependencies: deps_libgweather,
@@ -91,13 +100,6 @@ gweather_gir = gnome.generate_gir(lib_libgweather,
   install: true,
 )
 
-libgweather_dep = declare_dependency(
-  sources: [gweather_enum_types[1], gweather_gir],
-  dependencies: deps_libgweather,
-  link_with: lib_libgweather,
-  include_directories: root_inc,
-)
-
 if enable_vala
   gnome.generate_vapi('gweather-3.0',
     sources: gweather_gir[0],
@@ -106,11 +108,13 @@ if enable_vala
     install: true
   )
 endif
+endif
 
 test_cargs = ['-DTEST_LOCATIONS="@0@"'.format(locations_bin.full_path()),
               '-DSCHEMASDIR="@0@/schemas"'.format(meson.source_root()),
               '-DSCHEMAS_BUILDDIR="@0@/schemas"'.format(meson.build_root())]
 
+if false
 executable('test_locations',
   ['test_locations.c'],
   c_args: test_cargs,
@@ -121,6 +125,7 @@ executable('test_locations_utc',
   c_args: test_cargs,
   dependencies: libgweather_dep,
   install: false)
+endif
 
 exe = executable('test_libgweather',
   ['test_libgweather.c'],
@@ -129,6 +134,7 @@ exe = executable('test_libgweather',
   install: false)
 test('test_libgweather', exe, depends: [locations_bin])
 
+if false
 executable('test_metar',
   ['test_metar.c', gweather_c_sources],
   c_args: test_cargs,
@@ -144,3 +150,4 @@ executable('test_weather',
   c_args: test_cargs,
   dependencies: libgweather_dep,
   install: false)
+endif
diff --git a/meson.build b/meson.build
index 87f9a7d8..48ff0ca2 100644
--- a/meson.build
+++ b/meson.build
@@ -104,6 +104,10 @@ else
   enable_vala = enable_vala != 'false'
 endif
 
+if enable_vala and not get_option('introspection')
+  error('Vala bindings require introspection support')
+endif
+
 root_inc = include_directories('.')
 
 subdir('data')
diff --git a/meson_options.txt b/meson_options.txt
index 19b2c6a7..bf4c5175 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,3 +8,5 @@ option('enable_vala', type: 'combo', choices : ['true', 'false', 'auto'], value
        description: 'Install vala bindings')
 option('gtk_doc', type: 'boolean', value: false,
        description: 'Whether to generate the API reference')
+option('introspection', type: 'boolean', value: true,
+       description: 'generate GObject Introspection data')
-- 
2.26.2