Added test for declare_dependency.
This commit is contained in:
parent
0da1fbcb98
commit
1d4af5c84e
|
@ -0,0 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
int entity_func1();
|
||||
int entity_func2();
|
|
@ -0,0 +1,5 @@
|
|||
#include"entity.h"
|
||||
|
||||
int entity_func1() {
|
||||
return 5;
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
#include<entity.h>
|
||||
|
||||
int entity_func2() {
|
||||
return 9;
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
entity_lib = static_library('entity', 'entity1.c')
|
||||
|
||||
entity_dep = declare_dependency(link_with : entity_lib,
|
||||
include_directories : include_directories('.'),
|
||||
sources : 'entity2.c')
|
|
@ -0,0 +1,14 @@
|
|||
#include<entity.h>
|
||||
#include<stdio.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if(entity_func1() != 5) {
|
||||
printf("Error in func1.\n");
|
||||
return 1;
|
||||
}
|
||||
if(entity_func2() != 9) {
|
||||
printf("Error in func2.\n");
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
project('declare dependency', 'c')
|
||||
|
||||
subdir('entity')
|
||||
|
||||
exe = executable('dep_user', 'main.c',
|
||||
dependencies : entity_dep)
|
||||
test('dep', exe)
|
Loading…
Reference in New Issue