/[escript]/trunk/esysUtils/src/SConscript
ViewVC logotype

Diff of /trunk/esysUtils/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3258 by jfenwick, Tue Aug 3 03:12:16 2010 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 11  Line 11 
11  #  #
12  ########################################################  ########################################################
13    
   
 import os  
14  Import('*')  Import('*')
15    local_env = env.Clone()
 local_env = clone_env(env_mpi)  
16    
17  sources = """  sources = """
18      EsysAssertException.cpp      EsysAssertException.cpp
19      EsysException.cpp      EsysException.cpp
20        Esys_MPI.c
21        error.c
22      esysExceptionTranslator.cpp      esysExceptionTranslator.cpp
23          blocktimer.c      blocktimer.c
24  """.split()  """.split()
25    
26  headers = """  headers = """
27      EsysAssert.h      EsysAssert.h
28      EsysAssertException.h      EsysAssertException.h
29      EsysException.h      EsysException.h
30      EsysTypes.h      EsysTypes.h
31        Esys_MPI.h
32        error.h
33      esys_malloc.h      esys_malloc.h
34      esysExceptionTranslator.h      esysExceptionTranslator.h
35          blocktimer.h      blocktimer.h
36        mem.h
37        mpi_C.h
38        index.h
39        maths.h
40      system_dep.h      system_dep.h
41        types.h
42  """.split()  """.split()
43    
44  lib_name = 'esysUtils'  lib_name = 'esysUtils'
45    
46  if IS_WINDOWS_PLATFORM :  if IS_WINDOWS:
47    local_env.Append(CPPDEFINES = ['ESYSUTILS_EXPORTS'])      local_env.Append(CPPDEFINES = ['ESYSUTILS_EXPORTS'])
   
 if local_env['share_esysUtils'] :  
   lib = local_env.SharedLibrary(lib_name, sources)  
 else:  
   lib = local_env.StaticLibrary(lib_name, sources)  
   
 env.Alias('target_esysUtils_a', lib)  
48    
49  include_path = Dir(lib_name, local_env['incinstall'])  include_path = Dir(lib_name, local_env['incinstall'])
50    hdr_inst = local_env.Install(include_path, headers)
51    
52  tmp1 = local_env.Install(include_path, headers )  if local_env['share_esysutils']:
53  env.Alias('target_install_esysUtils_headers', [tmp1])      lib = local_env.SharedLibrary(lib_name, sources)
54    else:
55  tmp3 = local_env.Install(local_env['libinstall'], lib)      lib = local_env.StaticLibrary(lib_name, sources)
 env.Alias('target_install_esysUtils_a', tmp3)  
56    
57  # Call the unit tests SConscript  lib_inst = local_env.Install(local_env['libinstall'], lib)
 # export the lib target since tests will depend on it  
 # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)  
 # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?  
58    
59  dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]  env.Alias('build_esysUtils_lib', lib)
60  Export('dep_lib')  env.Alias('install_esysUtils_headers', hdr_inst)
61    env.Alias('install_esysUtils_lib', lib_inst)
62    
63  CallSConscript(local_env,dirs = ['#/esysUtils/test'], variant_dir='#/build/$PLATFORM/esysUtils/test', duplicate=0)  # configure the unit tests
64    local_env.SConscript(dirs=['#/esysUtils/test'], variant_dir='#/build/$PLATFORM/esysUtils/test', duplicate=0)
65    

Legend:
Removed from v.3258  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26