aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/frameworks/7 gnome/gir/meson.build
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/frameworks/7 gnome/gir/meson.build
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/frameworks/7 gnome/gir/meson.build')
-rw-r--r--meson/test cases/frameworks/7 gnome/gir/meson.build64
1 files changed, 64 insertions, 0 deletions
diff --git a/meson/test cases/frameworks/7 gnome/gir/meson.build b/meson/test cases/frameworks/7 gnome/gir/meson.build
new file mode 100644
index 000000000..64c49f729
--- /dev/null
+++ b/meson/test cases/frameworks/7 gnome/gir/meson.build
@@ -0,0 +1,64 @@
+subdir('dep1')
+
+libsources = ['meson-sample.c', 'meson-sample.h']
+lib2sources = ['meson-sample2.c', 'meson-sample2.h']
+
+gen_source = custom_target(
+ 'meson_smaple3.h',
+ input : 'meson-sample.h',
+ output : 'meson-sample3.h',
+ command : [find_program('copy.py'), '@INPUT@', '@OUTPUT@'],
+ build_by_default : false, # this will force a race condition if one exists
+)
+
+girlib = shared_library(
+ 'gir_lib',
+ sources : libsources,
+ dependencies : [gobj, dep1_dep],
+ install : true
+)
+
+girlib2 = shared_library(
+ 'gir_lib2',
+ sources : lib2sources,
+ dependencies : [gobj],
+ install : true
+)
+
+girexe = executable(
+ 'girprog',
+ sources : 'prog.c',
+ dependencies : [glib, gobj, gir, dep1_dep],
+ link_with : girlib
+)
+
+fake_dep = dependency('no-way-this-exists', required: false)
+
+gnome.generate_gir(
+ girlib, girlib2,
+ sources : [libsources, lib2sources, gen_source],
+ nsversion : '1.0',
+ namespace : 'Meson',
+ symbol_prefix : 'meson',
+ identifier_prefix : 'Meson',
+ includes : ['GObject-2.0', 'MesonDep1-1.0'],
+ # dep1_dep pulls in dep2_dep for us
+ dependencies : [[fake_dep, dep1_dep]],
+ install : true,
+ build_by_default : true,
+ # Test that unknown kwargs do not crash the parser.
+ # Unknown kwargs will eventually become a hard error.
+ # Once that happens remove this.
+ unknown_kwarg : true,
+)
+
+test('gobject introspection/c', girexe)
+gir_paths = ':'.join([girlib.outdir(), dep1lib.outdir(), dep2lib.outdir(), dep3lib.outdir()])
+envdata = environment()
+envdata.append('GI_TYPELIB_PATH', gir_paths, separator : ':')
+envdata.append('LD_LIBRARY_PATH', gir_paths)
+if ['windows', 'cygwin'].contains(host_machine.system())
+ envdata.append('PATH', gir_paths)
+endif
+test('gobject introspection/py', find_program('prog.py'),
+ env : envdata)