aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-02-28 18:02:50 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-02-29 21:28:16 +0200
commit52b66edb6cfb891e3a6b8c18d50d98e98dd100ec (patch)
treebd7309ad28ac96d2ab72befccfaecca6405039bb /test cases
parent352b5badd217dc937d9fcf5ff3c127e1d5dce6fc (diff)
downloadmeson-52b66edb6cfb891e3a6b8c18d50d98e98dd100ec.zip
meson-52b66edb6cfb891e3a6b8c18d50d98e98dd100ec.tar.gz
meson-52b66edb6cfb891e3a6b8c18d50d98e98dd100ec.tar.bz2
Can specify compile and link args for internal deps.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/87 declare dep/entity/entity1.c4
-rw-r--r--test cases/common/87 declare dep/entity/meson.build4
-rw-r--r--test cases/common/87 declare dep/main.c4
3 files changed, 11 insertions, 1 deletions
diff --git a/test cases/common/87 declare dep/entity/entity1.c b/test cases/common/87 declare dep/entity/entity1.c
index 9b5024a..204eb8b 100644
--- a/test cases/common/87 declare dep/entity/entity1.c
+++ b/test cases/common/87 declare dep/entity/entity1.c
@@ -1,5 +1,9 @@
#include"entity.h"
+#ifdef USING_ENT
+#error "Entity use flag leaked into entity compilation."
+#endif
+
int entity_func1() {
return 5;
}
diff --git a/test cases/common/87 declare dep/entity/meson.build b/test cases/common/87 declare dep/entity/meson.build
index d427bc3..12050b5 100644
--- a/test cases/common/87 declare dep/entity/meson.build
+++ b/test cases/common/87 declare dep/entity/meson.build
@@ -2,4 +2,6 @@ entity_lib = static_library('entity', 'entity1.c')
entity_dep = declare_dependency(link_with : entity_lib,
include_directories : include_directories('.'),
- sources : 'entity2.c')
+ sources : 'entity2.c',
+ compile_args : ['-DUSING_ENT=1'],
+ link_args : []) # No simple way of testing linker flags :(.
diff --git a/test cases/common/87 declare dep/main.c b/test cases/common/87 declare dep/main.c
index be6733a..4ad9d2a 100644
--- a/test cases/common/87 declare dep/main.c
+++ b/test cases/common/87 declare dep/main.c
@@ -1,6 +1,10 @@
#include<entity.h>
#include<stdio.h>
+#ifndef USING_ENT
+#error "Entity use flag not used for compilation."
+#endif
+
int main(int argc, char **argv) {
if(entity_func1() != 5) {
printf("Error in func1.\n");