/[escript]/trunk/esysUtils/test/EsysException/SConstruct
ViewVC logotype

Contents of /trunk/esysUtils/test/EsysException/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 246 - (show annotations)
Tue Nov 29 04:27:00 2005 UTC (13 years, 8 months ago) by jgs
File size: 2296 byte(s)
allow compile options to be loaded from a config
file specified on the command line to scons

1 # Scons configuration file for esysUtils unit tests
2
3 import os
4 import sys
5
6 # ensure correct versions of python and scons
7
8 EnsurePythonVersion(2,3)
9 EnsureSConsVersion(0,96)
10
11 #
12 # set appropriate defaults for configuration variables
13
14 esysroot = Dir('#../../..')
15 usegcc = 0
16 options = None
17
18 #
19 # retreive command-line arguments if any
20
21 if ARGUMENTS.get('usegcc',0):
22 usegcc = 1
23
24 if ARGUMENTS.get('options',0):
25 options = ARGUMENTS.get('options',0)
26
27 #
28 # determine platform
29
30 env = Environment(ENV = os.environ)
31 platform = env['PLATFORM']
32
33 #
34 # determine hostname
35
36 hostname = os.environ['HOSTNAME']
37
38 #
39 # load configuration settings
40
41 options_dir = str(esysroot) + '/scons'
42 sys.path.append(options_dir)
43
44 if hostname=='ess':
45 from ess_options import *
46
47 if usegcc==1:
48 from gcc_options import *
49
50 if options!=None:
51 exec "from " + options + " import *"
52
53 cxx_flags=cxx_flags_debug
54
55 #
56 # print out build configuration for this module
57
58 print "####################################################"
59 print "Build configuration for module: EsysException unit tests"
60 print " dodebug: 1"
61 print " usegcc: ", usegcc
62 print " cxx: ", cxx
63 print " platform: ", platform
64 print " hostname: ", hostname
65 print "####################################################"
66
67 #
68 # do the actual build
69
70 esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException'
71 esysUtils_path = str(esysroot) + '/esysUtils/inc'
72 CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'
73
74 esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
75 CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
76
77 cpp_path = [esysexception_test_path,
78 esysUtils_path,
79 CppUnitTest_path]
80
81 lib_path = [esysUtils_lib_path,
82 CppUnitTest_lib_path]
83
84 libs = ['esysUtils',
85 'CppUnitTest',
86 'guide',
87 'irc']
88
89 sources = ['EsysExceptionTestCase.cpp',
90 'EsysExceptionTest.cpp']
91
92 target = 'EsysExceptionTest.exe'
93
94 esysexception_env = Environment(ENV = os.environ)
95
96 esysexception_env.Replace(CXX = cxx)
97 esysexception_env.Replace(CXXFLAGS = cxx_flags)
98 esysexception_env.Replace(CPPPATH = cpp_path)
99 esysexception_env.Replace(LIBPATH = lib_path)
100 esysexception_env.Replace(LIBS = libs)
101
102 esysexception_test_exe = esysexception_env.Program(target, sources)

  ViewVC Help
Powered by ViewVC 1.1.26