diff options
author | Ole André Vadla RavnÄs <oleavr@gmail.com> | 2017-05-13 22:14:03 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-14 11:54:42 +0300 |
commit | 9b5df6e442672f8e7d6ead666a766234ccf41277 (patch) | |
tree | 3a8e4e6a8f9817da0cf7dbe8629e947b4e7d0fa3 /test cases/vala | |
parent | 1472f419ea14850cf0e3b01a72e66e67a1bccdf1 (diff) | |
download | meson-9b5df6e442672f8e7d6ead666a766234ccf41277.zip meson-9b5df6e442672f8e7d6ead666a766234ccf41277.tar.gz meson-9b5df6e442672f8e7d6ead666a766234ccf41277.tar.bz2 |
ninja: Deduplicate dependent vapis
The Vala compiler does not like being fed the same .vapi multiple times.
Diffstat (limited to 'test cases/vala')
-rw-r--r-- | test cases/vala/18 vapi consumed twice/app.vala | 11 | ||||
-rw-r--r-- | test cases/vala/18 vapi consumed twice/beer.vala | 10 | ||||
-rw-r--r-- | test cases/vala/18 vapi consumed twice/meson.build | 15 | ||||
-rw-r--r-- | test cases/vala/18 vapi consumed twice/person.vala | 16 |
4 files changed, 52 insertions, 0 deletions
diff --git a/test cases/vala/18 vapi consumed twice/app.vala b/test cases/vala/18 vapi consumed twice/app.vala new file mode 100644 index 0000000..cd94a42 --- /dev/null +++ b/test cases/vala/18 vapi consumed twice/app.vala @@ -0,0 +1,11 @@ +namespace App { + public static int main(string[] args) { + var person = new Person(); + print("Favorite beer of \"%s\" is %s\n", person.name, person.favorite_beer.flavor); + + var beer = new Beer("tasty"); + print("This beer is %s\n", beer.flavor); + + return 0; + } +} diff --git a/test cases/vala/18 vapi consumed twice/beer.vala b/test cases/vala/18 vapi consumed twice/beer.vala new file mode 100644 index 0000000..cee38ad --- /dev/null +++ b/test cases/vala/18 vapi consumed twice/beer.vala @@ -0,0 +1,10 @@ +public class Beer : Object { + public string flavor { + get; + construct; + } + + public Beer(string flavor) { + Object(flavor: flavor); + } +} diff --git a/test cases/vala/18 vapi consumed twice/meson.build b/test cases/vala/18 vapi consumed twice/meson.build new file mode 100644 index 0000000..6a7f5eb --- /dev/null +++ b/test cases/vala/18 vapi consumed twice/meson.build @@ -0,0 +1,15 @@ +project('vapi consumed twice', 'vala', 'c') + +base_deps = [dependency('glib-2.0'), dependency('gobject-2.0')] + +beer = library('beer', 'beer.vala', dependencies : base_deps) +beer_dep = declare_dependency(link_with : beer) + +person = library('person', 'person.vala', link_with : beer, + dependencies : base_deps) +person_dep = declare_dependency(link_with : person, dependencies : [beer_dep]) + +app = executable('app', 'app.vala', + dependencies : base_deps + [person_dep, beer_dep]) + +test('valavapiconsumedtwicetest', app) diff --git a/test cases/vala/18 vapi consumed twice/person.vala b/test cases/vala/18 vapi consumed twice/person.vala new file mode 100644 index 0000000..36b0025 --- /dev/null +++ b/test cases/vala/18 vapi consumed twice/person.vala @@ -0,0 +1,16 @@ +public class Person : Object { + public string name { + get { + return "Joe Badger"; + } + } + + public Beer favorite_beer { + get; + construct; + } + + public Person() { + Object(favorite_beer: new Beer("smooth")); + } +} |