130 lines
4 KiB
Diff
130 lines
4 KiB
Diff
diff --git libgweather/meson.build libgweather/meson.build
|
|
index 301e7e8..7da6a4e 100644
|
|
--- libgweather/meson.build
|
|
+++ libgweather/meson.build
|
|
@@ -65,29 +65,31 @@ lib_libgweather = shared_library('gweather-3',
|
|
install: true,
|
|
)
|
|
|
|
-gweather_gir = gnome.generate_gir(lib_libgweather,
|
|
- sources: introspection_sources,
|
|
- dependencies: deps_libgweather,
|
|
- nsversion: '3.0',
|
|
- namespace: 'GWeather',
|
|
- includes: ['GObject-2.0', 'Gtk-3.0'],
|
|
- symbol_prefix: 'gweather',
|
|
- identifier_prefix: 'GWeather',
|
|
- export_packages: 'gweather-3.0',
|
|
- header: 'libgweather/gweather.h',
|
|
- extra_args: [
|
|
- '--warn-all',
|
|
- '-DGWEATHER_COMPILATION',
|
|
- ],
|
|
- install: true,
|
|
-)
|
|
+if get_option('introspection')
|
|
+ gweather_gir = gnome.generate_gir(lib_libgweather,
|
|
+ sources: introspection_sources,
|
|
+ dependencies: deps_libgweather,
|
|
+ nsversion: '3.0',
|
|
+ namespace: 'GWeather',
|
|
+ includes: ['GObject-2.0', 'Gtk-3.0'],
|
|
+ symbol_prefix: 'gweather',
|
|
+ identifier_prefix: 'GWeather',
|
|
+ export_packages: 'gweather-3.0',
|
|
+ header: 'libgweather/gweather.h',
|
|
+ extra_args: [
|
|
+ '--warn-all',
|
|
+ '-DGWEATHER_COMPILATION',
|
|
+ ],
|
|
+ install: true,
|
|
+ )
|
|
|
|
-libgweather_dep = declare_dependency(
|
|
- sources: [gweather_enum_types[1], gweather_gir],
|
|
- dependencies: deps_libgweather,
|
|
- link_with: lib_libgweather,
|
|
- include_directories: root_inc,
|
|
-)
|
|
+ libgweather_dep = declare_dependency(
|
|
+ sources: [gweather_enum_types[1], gweather_gir],
|
|
+ dependencies: deps_libgweather,
|
|
+ link_with: lib_libgweather,
|
|
+ include_directories: root_inc,
|
|
+ )
|
|
+endif
|
|
|
|
if enable_vala
|
|
gnome.generate_vapi('gweather-3.0',
|
|
@@ -102,31 +104,33 @@ test_cargs = ['-DTEST_SRCDIR="@0@/"'.format(meson.current_source_dir()),
|
|
'-DSCHEMASDIR="@0@/schemas"'.format(meson.source_root()),
|
|
'-DSCHEMAS_BUILDDIR="@0@/schemas"'.format(meson.build_root())]
|
|
|
|
-executable('test_locations',
|
|
- ['test_locations.c'],
|
|
- c_args: test_cargs,
|
|
- dependencies: libgweather_dep,
|
|
- install: false)
|
|
-executable('test_locations_utc',
|
|
- ['test_locations_utc.c'],
|
|
- c_args: test_cargs,
|
|
- dependencies: libgweather_dep,
|
|
- install: false)
|
|
+if get_option('test')
|
|
+ executable('test_locations',
|
|
+ ['test_locations.c'],
|
|
+ c_args: test_cargs,
|
|
+ dependencies: libgweather_dep,
|
|
+ install: false)
|
|
+ executable('test_locations_utc',
|
|
+ ['test_locations_utc.c'],
|
|
+ c_args: test_cargs,
|
|
+ dependencies: libgweather_dep,
|
|
+ install: false)
|
|
|
|
-exe = executable('test_libgweather',
|
|
- ['test_libgweather.c'],
|
|
- c_args: test_cargs,
|
|
- dependencies: libgweather_dep,
|
|
- install: false)
|
|
-test('test_named_timezones', exe)
|
|
+ exe = executable('test_libgweather',
|
|
+ ['test_libgweather.c'],
|
|
+ c_args: test_cargs,
|
|
+ dependencies: libgweather_dep,
|
|
+ install: false)
|
|
+ test('test_named_timezones', exe)
|
|
|
|
-executable('test_metar',
|
|
- ['test_metar.c', gweather_c_sources],
|
|
- c_args: test_cargs,
|
|
- dependencies: libgweather_dep,
|
|
- install: false)
|
|
-executable('test_sun_moon',
|
|
- ['test_sun_moon.c', 'weather-sun.c', 'weather-moon.c'],
|
|
- c_args: test_cargs,
|
|
- dependencies: libgweather_dep,
|
|
- install: false)
|
|
+ executable('test_metar',
|
|
+ ['test_metar.c', gweather_c_sources],
|
|
+ c_args: test_cargs,
|
|
+ dependencies: libgweather_dep,
|
|
+ install: false)
|
|
+ executable('test_sun_moon',
|
|
+ ['test_sun_moon.c', 'weather-sun.c', 'weather-moon.c'],
|
|
+ c_args: test_cargs,
|
|
+ dependencies: libgweather_dep,
|
|
+ install: false)
|
|
+endif
|
|
diff --git meson_options.txt meson_options.txt
|
|
index 19b2c6a..3025a5f 100644
|
|
--- meson_options.txt
|
|
+++ meson_options.txt
|
|
@@ -8,3 +8,7 @@ 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: false,
|
|
+ description: 'Whether to generate gobject introspection data')
|
|
+option('test', type: 'boolean', value: false,
|
|
+ description: 'Whether to build test executables')
|