mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Simple sub-project that builds a library and and an exe that depends on it.
[SVN r14423]
This commit is contained in:
18
examples/lib_use/Jamfile
Normal file
18
examples/lib_use/Jamfile
Normal file
@@ -0,0 +1,18 @@
|
||||
subproject tools/build/examples/lib_use ;
|
||||
|
||||
lib simple
|
||||
:
|
||||
simple_lib.cpp
|
||||
:
|
||||
:
|
||||
debug <threading>single/multi
|
||||
;
|
||||
|
||||
exe simple
|
||||
:
|
||||
simple.cpp
|
||||
<lib>simple
|
||||
:
|
||||
<threading>multi
|
||||
:
|
||||
;
|
||||
12
examples/lib_use/simple.cpp
Normal file
12
examples/lib_use/simple.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <cstdio>
|
||||
|
||||
extern int lib_call(int x);
|
||||
|
||||
int main(int /* argc */, char ** /* argv */)
|
||||
{
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
std::printf("%d * 2 = %d\n",i,lib_call(i));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
6
examples/lib_use/simple_lib.cpp
Normal file
6
examples/lib_use/simple_lib.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
extern int lib_call(int x);
|
||||
|
||||
int lib_call(int x)
|
||||
{
|
||||
return x*2;
|
||||
}
|
||||
18
v1/example/lib_use/Jamfile
Normal file
18
v1/example/lib_use/Jamfile
Normal file
@@ -0,0 +1,18 @@
|
||||
subproject tools/build/examples/lib_use ;
|
||||
|
||||
lib simple
|
||||
:
|
||||
simple_lib.cpp
|
||||
:
|
||||
:
|
||||
debug <threading>single/multi
|
||||
;
|
||||
|
||||
exe simple
|
||||
:
|
||||
simple.cpp
|
||||
<lib>simple
|
||||
:
|
||||
<threading>multi
|
||||
:
|
||||
;
|
||||
12
v1/example/lib_use/simple.cpp
Normal file
12
v1/example/lib_use/simple.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <cstdio>
|
||||
|
||||
extern int lib_call(int x);
|
||||
|
||||
int main(int /* argc */, char ** /* argv */)
|
||||
{
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
std::printf("%d * 2 = %d\n",i,lib_call(i));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
6
v1/example/lib_use/simple_lib.cpp
Normal file
6
v1/example/lib_use/simple_lib.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
extern int lib_call(int x);
|
||||
|
||||
int lib_call(int x)
|
||||
{
|
||||
return x*2;
|
||||
}
|
||||
Reference in New Issue
Block a user