add SharedObject and SharedLibrary builders - close #8
This commit is contained in:
1 parent
6bd7e6f852
commit
df52a7e0e1
10 files changed
+267
No files matched your search
@@ -0,0 +1,11 @@
|
||||
Rscons::Environment.new do |env|
|
||||
env["CPPPATH"] << "src/lib"
|
||||
libmine = env.SharedLibrary("libmine", Dir["src/lib/*.c"])
|
||||
env.Program("test-shared.exe",
|
||||
Dir["src/*.c"],
|
||||
"LIBPATH" => %w[.],
|
||||
"LIBS" => %w[mine])
|
||||
env.build_after("test-shared.exe", libmine.to_s)
|
||||
env.Program("test-static.exe",
|
||||
Dir["src/**/*.c"])
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void one(void)
|
||||
{
|
||||
printf("Hi from one()\n");
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#ifndef ONE_H
|
||||
|
||||
void one(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void two(void)
|
||||
{
|
||||
printf("Hi from two()\n");
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#ifndef TWO_H
|
||||
|
||||
void two(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "one.h"
|
||||
#include "two.h"
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
one();
|
||||
two();
|
||||
}
|
||||
Reference in new issue
Block a user