/[escript]/trunk/bruce/test/Bruce/SConstruct
ViewVC logotype

Annotation of /trunk/bruce/test/Bruce/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 241 - (hide annotations)
Mon Nov 28 06:14:47 2005 UTC (14 years ago) by jgs
File size: 2457 byte(s)
if usegcc=1 is set on command line, load compiler options
fropm scons/gcc_options.py

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

  ViewVC Help
Powered by ViewVC 1.1.26