parent
641b627906
commit
b8b608a2a1
6 changed files with 47 additions and 0 deletions
@ -0,0 +1,9 @@ |
||||
project('subproj user', 'c') |
||||
|
||||
sub = subproject('sublib') |
||||
|
||||
inc = sub.get_variable('i') |
||||
lib = sub.get_variable('l') |
||||
|
||||
e = executable('user.c', include_dirs : inc, link_with : lib) |
||||
test('subdirtest', e) |
@ -0,0 +1,6 @@ |
||||
#ifndef SUBDEFS_H_ |
||||
#define SUBDEFS_H_ |
||||
|
||||
int subfunc(); |
||||
|
||||
#endif |
@ -0,0 +1,6 @@ |
||||
project('subproject', 'c') |
||||
|
||||
i = include_directories('include') |
||||
l = shared_library('sublib', 'sublib.c', include_dirs : i, install : true) |
||||
t = executable('simpletest', 'simpletest.c', include_dirs : i, link_with : l) |
||||
test('plain', t) |
@ -0,0 +1,5 @@ |
||||
#include<subdefs.h> |
||||
|
||||
int main(int argc, char **argv) { |
||||
return subfunc() == 42 ? 0 : 1; |
||||
} |
@ -0,0 +1,5 @@ |
||||
#include<subdefs.h> |
||||
|
||||
int subfunc() { |
||||
return 42; |
||||
} |
@ -0,0 +1,16 @@ |
||||
#include<subdefs.h> |
||||
#include<stdio.h> |
||||
|
||||
|
||||
int main(int argc, char **argv) { |
||||
int res; |
||||
printf("Calling into sublib now.\n"); |
||||
res = subfunc(); |
||||
if(res == 42) { |
||||
printf("Everything is fine.\n"); |
||||
return 0; |
||||
} else { |
||||
printf("Something went wrong.\n"); |
||||
return 1; |
||||
} |
||||
} |
Loading…
Reference in new issue