Fix use of shared subprojects.

pull/100/head
Jussi Pakkanen 10 years ago
parent e3b72045c4
commit d532dbef42
  1. 11
      contributing.txt
  2. 3
      interpreter.py
  3. 13
      test cases/common/79 shared subproject/a.c
  4. 3
      test cases/common/79 shared subproject/meson.build
  5. 12
      test cases/common/79 shared subproject/subprojects/B/b.c
  6. 6
      test cases/common/79 shared subproject/subprojects/C/c.c

@ -6,7 +6,7 @@ mailing list. Remember to add your name to the list of contributors
in authors.txt.
Coding style
Python Coding style
Meson follows the basic Python coding style. Additional rules are the
following:
@ -20,6 +20,15 @@ following:
a big feature)
C/C++ coding style
Meson has a bunch of test code in several languages. The rules for
those are simple.
- indent 4 spaces, no tabs ever
- brace always on the same line as if/for/else/function definition
External dependencies
The goal of Meson is to be as easily usable as possible. The user

@ -1020,7 +1020,7 @@ class Interpreter():
fullstack = self.subproject_stack + [dirname]
incpath = ' => '.join(fullstack)
raise InterpreterException('Recursive include of subprojects: %s.' % incpath)
if dirname == self.subprojects:
if dirname in self.subprojects:
return self.subprojects[dirname]
subdir = os.path.join('subprojects', dirname)
r = wrap.Resolver(os.path.join(self.build.environment.get_source_dir(), 'subprojects'))
@ -1037,6 +1037,7 @@ class Interpreter():
subi.run()
mlog.log('\nSubproject', mlog.bold(dirname), 'finished.')
self.build.subprojects[dirname] = True
self.subprojects.update(subi.subprojects)
self.subprojects[dirname] = SubprojectHolder(subi)
self.build_def_files += subi.build_def_files
return self.subprojects[dirname]

@ -0,0 +1,13 @@
#include<assert.h>
char func_b();
char func_c();
int main(int argc, char **argv) {
if(func_b() != 'b') {
return 1;
}
if(func_c() != 'c') {
return 2;
}
return 0;
}

@ -6,4 +6,5 @@ b = B.get_variable('b')
C = subproject('C')
c = B.get_variable('c')
a = executable('a', 'a.c', link_with : [ b, c ])
a = executable('a', 'a.c', link_with : [b, c])
test('a test', a)

@ -1,5 +1,9 @@
char
func_b()
{
return 'b';
#include<stdlib.h>
char func_c();
char func_b() {
if(func_c() != 'c') {
exit(3);
}
return 'b';
}

@ -1,5 +1,3 @@
char
func_c()
{
return 'c';
char func_c() {
return 'c';
}

Loading…
Cancel
Save