Commit a0952469 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#724 SCons: introduce new aliases for each HappyHeart program (so it's...

#724 SCons: introduce new aliases for each HappyHeart program (so it's possible to build only the ones actually required).
parent c7f1a719
......@@ -16,7 +16,6 @@ main_elasticity_src = Split('''
main.cpp
''')
elasticity = HappyHeartProgram(env, 'elasticity', main_elasticity_src, [elasticity_lib, all_libs])
list_exec = (elasticity, )
......
......@@ -16,7 +16,7 @@ for problem in problems:
(executable_list, library_list) = SConscript(os.path.join(problem, 'SConscript'), ['env', 'all_libs', 'HappyHeartLibrary', 'HappyHeartProgram'], duplicate=0)
for executable in executable_list:
all_instances_executable_list.append(executable)
all_instances_executable_list.append(executable)
for library in library_list:
all_instances_library_list.append(library)
......@@ -24,7 +24,7 @@ for problem in problems:
fsi_requirements_lib.append(library)
# Handle apart FSI case which needs elastic and hyperelastic libraries.
# Handle apart FSI case which needs hyperelastic library.
(executable_list, library_list) = SConscript(os.path.join("FSI_EI", 'SConscript'), ['env', 'all_libs', 'fsi_requirements_lib', 'HappyHeartLibrary', 'HappyHeartProgram'], duplicate=0)
for executable in executable_list:
......
......@@ -365,7 +365,7 @@ def HappyHeartLibrary(env, name, source_file_list, link_libraries_list):
def HappyHeartProgram(env, name, source_file, link_libraries_list):
"""Build a library from a list of sources; its nature depends on env["LIBRARY_TYPE"].
"""Build a program.
\param[in] env Environment.
\param[in] name Name of the program to build. Don't bother with extensions: SCons handles them itself.
......@@ -375,12 +375,15 @@ def HappyHeartProgram(env, name, source_file, link_libraries_list):
\return The Program as a SCons node object.
"""
return env.Program('{0}-{1}'.format(name, env["LIBRARY_TYPE"]),
source_file,
LIBS=link_libraries_list,
LIBPATH=env['LIBPATH'])
program = env.Program('{0}-{1}'.format(name, env["LIBRARY_TYPE"]),
source_file,
LIBS=link_libraries_list,
LIBPATH=env['LIBPATH'])
env.Alias(name, os.path.join(target_variant_directory, name))
return program
# Add to the environment the Prelink builder.
builder = Builder(action=Prelink)
......@@ -457,7 +460,6 @@ if env['LIBRARY_TYPE'] == "shared":
# Create an alias: type 'scons all' in command line to populate fully the target_variant_directory.
# 'scons' alone is not enough, because I choose an installation directory outside of source folder.
print target_variant_directory
env.Alias('all', target_variant_directory)
# List of libraries to build; a folder with the same name is expected to exist.
......@@ -510,7 +512,7 @@ env.Alias('libraries', libs_for_alias)
exports=(['env', 'all_libs', 'HappyHeartLibrary', 'HappyHeartProgram']),
variant_dir=os.path.join(intermediate_variant_directory, 'ModelInstances'),
duplicate=0)
list_test_exec = SConscript('Test/SConscript',
exports=(['env', 'all_libs']),
variant_dir=os.path.join(intermediate_variant_directory, 'Tests'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment