[cig-commits] commit: Adding the ability to build sub-directories

Mercurial hg at geodynamics.org
Mon Nov 24 11:29:30 PST 2008


changeset:   69:6260f788c5ff
user:        LukeHodkinson
date:        Mon Aug 11 10:31:37 2008 +0000
files:       SConscript
description:
Adding the ability to build sub-directories
individually. Libraries will be updated with
any changes made after any individual path
is built. Use it like this:

  scons target=<path to build>

For example:

  scons target=StGermain/Base

Will build everything under StGermain/Base.


diff -r cdd45a53b88e -r 6260f788c5ff SConscript
--- a/SConscript	Fri Aug 08 03:43:25 2008 +0000
+++ b/SConscript	Mon Aug 11 10:31:37 2008 +0000
@@ -44,18 +44,19 @@ if env['static_libraries']:
 
 #
 # Build unit test runner.
-env['PCURUNNERINIT'] = ''
-env['PCURUNNERSETUP'] = """StGermain_Init( &argc, &argv );
+if not env.get('dir_target', ''):
+    env['PCURUNNERINIT'] = ''
+    env['PCURUNNERSETUP'] = """StGermain_Init( &argc, &argv );
    StgDomain_Init( &argc, &argv );
    StgFEM_Init( &argc, &argv );"""
-env['PCURUNNERTEARDOWN'] = """StgFEM_Finalise();
+    env['PCURUNNERTEARDOWN'] = """StgFEM_Finalise();
    StgDomain_Finalise();
    StGermain_Finalise();"""
-runner_src = env.PCUSuiteRunner(env.get_build_path('glucifer/testglucifer.c'), env.suite_hdrs)
-runner_obj = env.SharedObject(runner_src)
-env.Program(env.get_build_path('bin/testglucifer'),
-            runner_obj + env.suite_objs,
-            LIBS=['glucifer', 'pcu'] + env.get('LIBS', []))
+    runner_src = env.PCUSuiteRunner(env.get_build_path('glucifer/testglucifer.c'), env.suite_hdrs)
+    runner_obj = env.SharedObject(runner_src)
+    env.Program(env.get_build_path('bin/testglucifer'),
+                runner_obj + env.suite_objs,
+                LIBS=['glucifer', 'pcu'] + env.get('LIBS', []))
 
 #
 # Copy over XML files.
@@ -63,4 +64,10 @@ for base in xml_bases:
 for base in xml_bases:
     dst = env.get_build_path('lib/StGermain/glucifer/' + base)
     for file in env.glob('ModelComponents/' + base + '/*.xml'):
-        env.Install(dst, file)
+        if env.check_dir_target(file):
+            env.Install(dst, file)
+
+#
+# Return any module code we need to build into a static binary.
+module = (env.get('STGMODULEPROTO', ''), env.get('STGMODULECODE', ''))
+Return('module')



More information about the CIG-COMMITS mailing list