ViewVC logotype

Contents of /branches/ROBW_XPLATFORM/bruce/test/SConscript

Parent Directory Parent Directory | Revision Log Revision Log

Revision 666 - (show annotations)
Fri Mar 24 11:29:40 2006 UTC (15 years, 2 months ago) by robwdcock
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 Import('*')
3 program_name = 'bruce_UnitTest'
5 local_env=env.Copy()
8 src_dir = local_env.Dir('.').srcnode().abspath
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']]
14 local_env.Append(LIBS=[ python_lib, boost_lib, 'esysUtils', 'CppUnitTest', sys_libs])
16 local_env.sharedLinkHack(['brucecpp', 'escriptcpp', ], libinstall, sources)
18 program = local_env.Program(program_name, sources)
20 Depends(program, dep_lib)
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)
26 #Add Unit Test to target alias
28 env.Alias('build_tests', test_install)
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)
35 local_env.SConscript(dirs = ['#/bruce/test/python'], build_dir='python', duplicate=0)

  ViewVC Help
Powered by ViewVC 1.1.26