From 140d836e9cd54fb67b969fd82ef7ed19ba574d40 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Sat, 26 Apr 2014 15:11:58 +0200 Subject: Imported Upstream version 2.3.1 --- doc/user/variants.in | 151 --------------------------------------------------- 1 file changed, 151 deletions(-) delete mode 100644 doc/user/variants.in (limited to 'doc/user/variants.in') diff --git a/doc/user/variants.in b/doc/user/variants.in deleted file mode 100644 index dc3315d..0000000 --- a/doc/user/variants.in +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - The &variant_dir; keyword argument of - the &SConscript; function provides everything - we need to show how easy it is to create - variant builds using &SCons;. - Suppose, for example, that we want to - build a program for both Windows and Linux platforms, - but that we want to build it in a shared directory - with separate side-by-side build directories - for the Windows and Linux versions of the program. - - - - - - platform = ARGUMENTS.get('OS', Platform()) - - include = "#export/$PLATFORM/include" - lib = "#export/$PLATFORM/lib" - bin = "#export/$PLATFORM/bin" - - env = Environment(PLATFORM = platform, - BINDIR = bin, - INCDIR = include, - LIBDIR = lib, - CPPPATH = [include], - LIBPATH = [lib], - LIBS = 'world') - - Export('env') - - env.SConscript('src/SConscript', variant_dir='build/$PLATFORM') - - - - - - Import('env') - SConscript('hello/SConscript') - SConscript('world/SConscript') - - - Import('env') - hello = env.Program('hello.c') - env.Install('$BINDIR', hello) - - - #include "world.h" - int main(int argc, char *argv[]) { printf "hello.c\n"; world(); } - - - Import('env') - world = env.Library('world.c') - env.Install('$LIBDIR', world) - env.Install('$INCDIR', 'world.h') - - - #define STRING "world.h" - extern int world(); - - - int world() { printf "world.c\n"; } - - - - - - This SConstruct file, - when run on a Linux system, yields: - - - - - scons -Q OS=linux - - - - - The same SConstruct file on Windows would build: - - - - - scons -Q OS=windows - - - -- cgit v1.2.3