LIBPATH = [ '.' ])
env.Library(target = 'foo1', source = 'f1.c')
Library(target = 'libfoo2', source = Split('f2a.c f2b.c f2c.c'))
-libtgt=env.Library(target = 'foo3', source = ['f3a.c', 'f3b.c', 'f3c.c'])
+libtgt=env.Library(target = 'foo3', source = ['f3a.c', 'f3b.c', 'f3c.cpp'])
env.Program(target = 'prog', source = [ 'prog.c', libtgt ])
""")
}
""")
-test.write('f3c.c', r"""
-void
+test.write('f3c.cpp', r"""
+#include <stdio.h>
+extern "C" void
f3c(void)
{
- printf("f3c.c\n");
+ printf("f3c.cpp\n");
}
""")
test.run(arguments = '.')
test.run(program = test.workpath('prog'),
- stdout = "f1.c\nf2a.c\nf2b.c\nf2c.c\nf3a.c\nf3b.c\nf3c.c\nprog.c\n")
+ stdout = "f1.c\nf2a.c\nf2b.c\nf2c.c\nf3a.c\nf3b.c\nf3c.cpp\nprog.c\n")
test.pass_test()