/[escript]/branches/scons-dev/bruce/test/SConscript
ViewVC logotype

Annotation of /branches/scons-dev/bruce/test/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 666 - (hide annotations)
Fri Mar 24 11:29:40 2006 UTC (13 years, 6 months ago) by robwdcock
Original Path: branches/ROBW_XPLATFORM/bruce/test/SConscript
File size: 1057 byte(s)
+ Fix up python esys area:
  + libraries are named without lib prefix on posix platforms (python standard)
  + libraries are now installed into the pyinstall area (python standard)
  + symlinks removed, no longer required
  + LD_LIBRARY_PATH is now optional for PYTHON programs (still required for c++)
+ lib PREFIX removal NOTES:
  + removing the lib prefix is non-standard for the linker. As such we've created a
    custom function sharedLinkHack to specify the .so on the link command line
    (as opposed to using -l<archive> which will prepend the lib). This has a
    a small slight of hand for scons which was being to "helpful". Scons
    verifies that when creating a shared libray all objects specified are
    created shareable (e.g. ensure objects are compiler with -fPIC). Since
    we are linking a .so out of the blue we had to wrap it up in a File note
    and flag it as shared.
    Easily done, once you know how. Thankfully this is all wrapped
    up in a simple function (sharedLinkHack) that looks like ordinary scons so
    you will never know!
    


1 robwdcock 642 Import('*')
2    
3     program_name = 'bruce_UnitTest'
4    
5     local_env=env.Copy()
6    
7    
8     src_dir = local_env.Dir('.').srcnode().abspath
9    
10     import os
11     filenames = os.listdir(src_dir)
12     sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
13    
14 robwdcock 666 local_env.Append(LIBS=[ python_lib, boost_lib, 'esysUtils', 'CppUnitTest', sys_libs])
15    
16     local_env.sharedLinkHack(['brucecpp', 'escriptcpp', ], libinstall, sources)
17    
18 robwdcock 642 program = local_env.Program(program_name, sources)
19    
20     Depends(program, dep_lib)
21    
22     # TODO: Need to decide on how the library paths etc are going to be handled
23     # TODO: For now just install the program to the same location as the libraries so things can run at least
24     test_install = local_env.Install(libinstall, program)
25    
26     #Add Unit Test to target alias
27    
28     env.Alias('build_tests', test_install)
29    
30     # run the tests - but only if test_targets are stale
31     local_env.RunUnitTest(program_name)
32     test_targets = os.path.splitext(program_name)[0]+'.passed'
33     Alias("run_tests", test_targets)
34    
35 robwdcock 661 local_env.SConscript(dirs = ['#/bruce/test/python'], build_dir='python', duplicate=0)

  ViewVC Help
Powered by ViewVC 1.1.26