diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-06-15 00:26:19 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-06-15 00:26:19 +0300 |
commit | 6d744b13ff205a4a85c298c620525d8a3b685447 (patch) | |
tree | 89cbfa3e9f7e63de77d33ba688037e0103700e76 /test cases | |
parent | ee0fee2111087a1082baaad3f53e871bd9123c69 (diff) | |
download | meson-6d744b13ff205a4a85c298c620525d8a3b685447.zip meson-6d744b13ff205a4a85c298c620525d8a3b685447.tar.gz meson-6d744b13ff205a4a85c298c620525d8a3b685447.tar.bz2 |
Now can create internal dependencies to simplify subproject usage.
Diffstat (limited to 'test cases')
8 files changed, 50 insertions, 0 deletions
diff --git a/test cases/common/85 internal dependency/meson.build b/test cases/common/85 internal dependency/meson.build new file mode 100644 index 0000000..6faedb0 --- /dev/null +++ b/test cases/common/85 internal dependency/meson.build @@ -0,0 +1,4 @@ +project('internal dependency', 'c') + +subdir('proj1') +subdir('src') diff --git a/test cases/common/85 internal dependency/proj1/include/proj1.h b/test cases/common/85 internal dependency/proj1/include/proj1.h new file mode 100644 index 0000000..ded6f75 --- /dev/null +++ b/test cases/common/85 internal dependency/proj1/include/proj1.h @@ -0,0 +1,5 @@ +#pragma once + +void proj1_func1(); +void proj1_func2(); +void proj1_func3(); diff --git a/test cases/common/85 internal dependency/proj1/meson.build b/test cases/common/85 internal dependency/proj1/meson.build new file mode 100644 index 0000000..422021e --- /dev/null +++ b/test cases/common/85 internal dependency/proj1/meson.build @@ -0,0 +1,11 @@ +incdirs = include_directories('include') + +p1lib = static_library('proj1', 'proj1f1.c', + include_directories : incdirs +) + +indirect_source = files('proj1f2.c') + +proj1_dep = declare_dependency(include_directories : incdirs, + link_with : p1lib, + sources : ['proj1f3.c', indirect_source]) diff --git a/test cases/common/85 internal dependency/proj1/proj1f1.c b/test cases/common/85 internal dependency/proj1/proj1f1.c new file mode 100644 index 0000000..9077f4f --- /dev/null +++ b/test cases/common/85 internal dependency/proj1/proj1f1.c @@ -0,0 +1,6 @@ +#include<proj1.h> +#include<stdio.h> + +void proj1_func1() { + printf("In proj1_func1.\n"); +} diff --git a/test cases/common/85 internal dependency/proj1/proj1f2.c b/test cases/common/85 internal dependency/proj1/proj1f2.c new file mode 100644 index 0000000..374ee4e --- /dev/null +++ b/test cases/common/85 internal dependency/proj1/proj1f2.c @@ -0,0 +1,6 @@ +#include<proj1.h> +#include<stdio.h> + +void proj1_func2() { + printf("In proj1_func2.\n"); +} diff --git a/test cases/common/85 internal dependency/proj1/proj1f3.c b/test cases/common/85 internal dependency/proj1/proj1f3.c new file mode 100644 index 0000000..8c8fca4 --- /dev/null +++ b/test cases/common/85 internal dependency/proj1/proj1f3.c @@ -0,0 +1,6 @@ +#include<proj1.h> +#include<stdio.h> + +void proj1_func3() { + printf("In proj1_func3.\n"); +} diff --git a/test cases/common/85 internal dependency/src/main.c b/test cases/common/85 internal dependency/src/main.c new file mode 100644 index 0000000..7d50b05 --- /dev/null +++ b/test cases/common/85 internal dependency/src/main.c @@ -0,0 +1,10 @@ +#include<stdio.h> +#include<proj1.h> + +int main(int argc, char **argv) { + printf("Now calling into library.\n"); + proj1_func1(); + proj1_func2(); + proj1_func3(); + return 0; +} diff --git a/test cases/common/85 internal dependency/src/meson.build b/test cases/common/85 internal dependency/src/meson.build new file mode 100644 index 0000000..89f99ab --- /dev/null +++ b/test cases/common/85 internal dependency/src/meson.build @@ -0,0 +1,2 @@ +exe = executable('projtest', 'main.c', dependencies : proj1_dep) +test('projtest', exe) |