[cig-commits] commit:
Mercurial
hg at geodynamics.org
Mon Nov 24 11:59:26 PST 2008
changeset: 137:4953943cab6f
user: LukeHodkinson
date: Mon Aug 11 10:37:52 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 b681563d014a -r 4953943cab6f SConscript
--- a/SConscript Mon Aug 11 04:27:48 2008 +0000
+++ b/SConscript Mon Aug 11 10:37:52 2008 +0000
@@ -30,29 +30,28 @@ if env['shared_libraries']:
env.SharedLibrary(env.get_build_path('lib/StgDomain'), env.src_objs)
# Build toolbox.
-objs = env.build_sources(env.glob('libStgDomain/Toolbox/*.c'), 'StgDomain/libStgDomain/Toolbox')
-objs += env.build_metas(env.glob('libStgDomain/Toolbox/*.meta'), 'StgDomain/libStgDomain/Toolbox')
-if env['shared_libraries']:
- env.SharedLibrary(env.get_target_name('lib/StgDomain_Toolboxmodule'), objs,
- SHLIBPREFIX='',
- LIBPREFIXES=env.make_list(env['LIBPREFIXES']) + [''],
- LIBS=['StgDomain'] + env.get('LIBS', []))
-if env['static_libraries']:
- env.src_objs += objs
+env.build_toolbox('libStgDomain/Toolbox')
#
# Build static library.
if env['static_libraries']:
env.Library(env.get_build_path('lib/StgDomain'), env.src_objs)
+#
# 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 );"""
-env['PCURUNNERTEARDOWN'] = """StgDomain_Finalise();
+ env['PCURUNNERTEARDOWN'] = """StgDomain_Finalise();
StGermain_Finalise();"""
-runner_src = env.PCUSuiteRunner(env.get_build_path('StgDomain/testStgDomain.c'), env.suite_hdrs)
-runner_obj = env.SharedObject(runner_src)
-env.Program(env.get_build_path('bin/testStgDomain'),
- runner_obj + env.suite_objs,
- LIBS=['StgDomain', 'pcu'] + env.get('LIBS', []))
+ runner_src = env.PCUSuiteRunner(env.get_build_path('StgDomain/testStgDomain.c'), env.suite_hdrs)
+ runner_obj = env.SharedObject(runner_src)
+ env.Program(env.get_build_path('bin/testStgDomain'),
+ runner_obj + env.suite_objs,
+ LIBS=['StgDomain', 'pcu'] + env.get('LIBS', []))
+
+#
+# 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