/[escript]/branches/RW_WIN32/SConstruct
ViewVC logotype

Annotation of /branches/RW_WIN32/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 220 - (hide annotations)
Thu Nov 24 09:11:38 2005 UTC (13 years, 6 months ago) by robwdcock
File size: 2999 byte(s)
Python compile builder function added to scons. Bruce sconscript file shows usage
1 robwdcock 186 opts = Options('custom.py')
2     opts.AddOptions(
3     BoolOption('RELEASE', 'Set to build for release', 0),
4     PathOption('PYTHON_HOME','Path to python home','C:/python23')
5     )
6 robwdcock 220
7    
8     # Extensions to Scons
9     def build_py(target, source, env):
10     # Code to build .pyc from .py
11     import py_compile, sys;
12     py_compile.compile(str(source[0]), str(target[0]))
13     return None
14     py_builder = Builder(action = build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
15    
16 robwdcock 186 env = Environment(tools = ['default'],options = opts)
17 robwdcock 220 env.Append(BUILDERS = {'PyCompile' : py_builder});
18 robwdcock 186
19     print "PLATFORM is:", env['PLATFORM']
20    
21     EnsurePythonVersion(2,3)
22    
23     #TODO: How do I convert these to options?
24     #TODO: Is there a more compact way of setting up the include paths?
25    
26     # Third-Party libraries
27 robwdcock 209 boost_home = 'E:/woo409/development/boost'
28     python_home = env['PYTHON_HOME']
29 robwdcock 186
30     # Where to install (and find) esys includes and libraries
31     # Note: #/ means relative to the top of source tree
32     esys_inc = '#/include'
33     esys_lib = '#/lib'
34    
35     # Derived paths
36     python_inc = python_home + '/include'
37     python_lib = python_home + '/libs'
38 robwdcock 209 boost_inc = boost_home
39     boost_lib = boost_home + '/windows_binary/lib'
40 robwdcock 186
41     incdir = [ boost_inc, python_inc, esys_inc ]
42 robwdcock 209 libdir = [ boost_lib, python_lib, esys_lib ]
43 robwdcock 186
44     env.Append(CPPPATH=incdir)
45     env.Append(LIBPATH=libdir)
46    
47     env.Append(CPPDEFINES = ['DOASSERT'])
48    
49     if env['PLATFORM'] == "win32":
50     env.Append(CCFLAGS = ' /GR /EHsc /TP /wd4068')
51     env.Append(CPPDEFINES = ['MSVC', 'WIN32'])
52     if False :
53     print "RELEASE build"
54     else:
55     print "DEBUG build"
56     env.Append(CCFLAGS = ' /Od /MDd /RTC1')
57     env.Append(CPPDEFINES = ['_DEBUG'])
58 robwdcock 209 boost_lib_name = 'boost_python-vc71-mt-sgd'
59 robwdcock 186
60 robwdcock 209 Export(["env", "incdir", "esys_inc", "esys_lib", "boost_lib_name" ])
61 robwdcock 186
62 robwdcock 220 # C/C++ Libraries
63 robwdcock 218 env.SConscript(dirs = ['paso/src'], build_dir='build/win32/paso', duplicate=0)
64     env.SConscript(dirs = ['bruce/src'], build_dir='build/win32/bruce', duplicate=0)
65     env.SConscript(dirs = ['escript/src/Data'], build_dir='build/win32/escript/Data', duplicate=0)
66     env.SConscript(dirs = ['esysUtils/src'], build_dir='build/win32/esysUtils', duplicate=0)
67     env.SConscript(dirs = ['win32/win32_utils'], build_dir='build/win32/win32_utils', duplicate=0)
68     env.SConscript(dirs = ['tools/mmio/src'], build_dir='build/win32/tools/mmio', duplicate=0)
69     env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/win32/tools/CppUnitTest', duplicate=0)
70     env.SConscript(dirs = ['finley/src/finleyC'], build_dir='build/win32/finleyC', duplicate=0)
71     env.SConscript(dirs = ['finley/src/CPPAdapter'], build_dir='build/win32/CPPAdapter', duplicate=0)
72    
73     # Unit Tests
74     env.SConscript(dirs = ['esysUtils/test/EsysException'], build_dir='build/win32/esysUtils/test/EsysException', duplicate=0)
75     env.SConscript(dirs = ['escript/test'], build_dir='build/win32/escript/test', duplicate=0)
76     env.SConscript(dirs = ['bruce/test'], build_dir='build/win32/bruce/test', duplicate=0)
77     env.SConscript(dirs = ['finley/test'], build_dir='build/win32/finley/test', duplicate=0)

  ViewVC Help
Powered by ViewVC 1.1.26