1 |
# Scons configuration file for DataBlocks2D unit tests |
2 |
|
3 |
import os |
4 |
import sys |
5 |
|
6 |
# |
7 |
# ensure correct versions of python and scons |
8 |
|
9 |
EnsurePythonVersion(2,3) |
10 |
EnsureSConsVersion(0,96) |
11 |
|
12 |
# |
13 |
# set appropriate defaults for configuration variables |
14 |
|
15 |
esysroot = Dir('#../../..') |
16 |
usegcc = 0 |
17 |
|
18 |
# |
19 |
# retreive command-line arguments if any |
20 |
|
21 |
if ARGUMENTS.get('usegcc',0): |
22 |
usegcc = 1 |
23 |
|
24 |
# |
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 |
cxx_flags=cxx_flags_debug |
45 |
|
46 |
# |
47 |
# print out build configuration for this module |
48 |
|
49 |
print "####################################################" |
50 |
print "Build configuration for module: DataBlocks2D unit tests" |
51 |
print " dodebug: 1" |
52 |
print " usegcc: ", usegcc |
53 |
print " cxx: ", cxx |
54 |
print " platform: ", platform |
55 |
print " hostname: ", hostname |
56 |
print "####################################################" |
57 |
|
58 |
# |
59 |
# do the actual build |
60 |
|
61 |
datablocks2d_test_path = str(esysroot) + '/escript/test/DataBlocks2D' |
62 |
escript_path = str(esysroot) + '/escript/inc' |
63 |
esysUtils_path = str(esysroot) + '/esysUtils/inc' |
64 |
CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc' |
65 |
|
66 |
esys_lib_path = str(esysroot) + '/lib' |
67 |
esysUtils_lib_path = str(esysroot) + '/esysUtils/lib' |
68 |
CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib' |
69 |
|
70 |
cpp_path = [datablocks2d_test_path, |
71 |
escript_path, |
72 |
esysUtils_path, |
73 |
CppUnitTest_path, |
74 |
python_path, |
75 |
boost_path] |
76 |
|
77 |
lib_path = [esys_lib_path, |
78 |
esysUtils_lib_path, |
79 |
CppUnitTest_lib_path, |
80 |
python_lib_path, |
81 |
boost_lib_path] |
82 |
|
83 |
libs = ['escriptcpp', |
84 |
'esysUtils', |
85 |
'CppUnitTest', |
86 |
str(python_lib), |
87 |
str(boost_lib), |
88 |
'dl', |
89 |
'util', |
90 |
'guide', |
91 |
'irc'] |
92 |
|
93 |
sources = ['DataBlocks2DTestCase.cpp', |
94 |
'DataBlocks2DTest.cpp'] |
95 |
|
96 |
target = 'DataBlocks2DTest.exe' |
97 |
|
98 |
datablocks2d_env = Environment(ENV = os.environ) |
99 |
|
100 |
datablocks2d_env.Replace(CXX = cxx) |
101 |
datablocks2d_env.Replace(CXXFLAGS = cxx_flags) |
102 |
datablocks2d_env.Replace(CPPPATH = cpp_path) |
103 |
datablocks2d_env.Replace(LIBPATH = lib_path) |
104 |
datablocks2d_env.Replace(LIBS = libs) |
105 |
|
106 |
datablocks2d_test_exe = datablocks2d_env.Program(target, sources) |