From 5ff4bd045127a65d0c19deb247d6142ca20a2b67 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 13 Jan 2004 09:57:55 +0000 Subject: [PATCH] Add new example. [SVN r21665] --- v2/example/variant/Jamfile | 9 +++++++++ v2/example/variant/a.cpp | 3 +++ v2/example/variant/libs/Jamfile | 2 ++ v2/example/variant/libs/l.cpp | 4 ++++ v2/example/variant/project-root.jam | 10 ++++++++++ v2/example/variant/readme.txt | 7 +++++++ 6 files changed, 35 insertions(+) create mode 100644 v2/example/variant/Jamfile create mode 100644 v2/example/variant/a.cpp create mode 100644 v2/example/variant/libs/Jamfile create mode 100644 v2/example/variant/libs/l.cpp create mode 100644 v2/example/variant/project-root.jam create mode 100644 v2/example/variant/readme.txt diff --git a/v2/example/variant/Jamfile b/v2/example/variant/Jamfile new file mode 100644 index 000000000..a14fe282b --- /dev/null +++ b/v2/example/variant/Jamfile @@ -0,0 +1,9 @@ + +# By default, build the project with two variants +# we've defined in project-root.jam +project + : default-build crazy super_release + ; + +exe a : a.cpp libs//l ; + diff --git a/v2/example/variant/a.cpp b/v2/example/variant/a.cpp new file mode 100644 index 000000000..3d92b3c19 --- /dev/null +++ b/v2/example/variant/a.cpp @@ -0,0 +1,3 @@ + +void l(); +int main() { l(); return 0; } \ No newline at end of file diff --git a/v2/example/variant/libs/Jamfile b/v2/example/variant/libs/Jamfile new file mode 100644 index 000000000..e3749a26a --- /dev/null +++ b/v2/example/variant/libs/Jamfile @@ -0,0 +1,2 @@ + +lib l : l.cpp ; \ No newline at end of file diff --git a/v2/example/variant/libs/l.cpp b/v2/example/variant/libs/l.cpp new file mode 100644 index 000000000..27417125a --- /dev/null +++ b/v2/example/variant/libs/l.cpp @@ -0,0 +1,4 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +void l() {} diff --git a/v2/example/variant/project-root.jam b/v2/example/variant/project-root.jam new file mode 100644 index 000000000..0de93a8e7 --- /dev/null +++ b/v2/example/variant/project-root.jam @@ -0,0 +1,10 @@ + +# Define a build variant which is just combination +# of four properties. +variant crazy : speed off + on on ; + +# Define a built variant inherited from 'release'. +# It defines one new property and get all properties +# from parent variant. +variant super_release : release : USE_ASM ; \ No newline at end of file diff --git a/v2/example/variant/readme.txt b/v2/example/variant/readme.txt new file mode 100644 index 000000000..304a84c0d --- /dev/null +++ b/v2/example/variant/readme.txt @@ -0,0 +1,7 @@ + +This example shows how user can create his own build variants. +Two variants are defined: "crazy", which is just random combination +of properties, and "super-release", which is inherited from "release", +and differs by a single define. + +See the project-root.jam for the definitions. \ No newline at end of file