[SCons] Generate versioned shared objects for cantera_shared.so

See #318.
This commit is contained in:
Ray Speth 2016-07-04 17:13:50 -04:00
parent 9b318f3c90
commit 908e620325
2 changed files with 13 additions and 6 deletions

View file

@ -605,8 +605,8 @@ for arg in ARGUMENTS:
# Require a StrictVersion-compatible version
env['cantera_version'] = "2.3.0a2"
ctversion = StrictVersion(env['cantera_version'])
# MSI versions do not support pre-release tags
env['cantera_msi_version'] = '.'.join(str(x) for x in ctversion.version)
# For use where pre-release tags are not permitted (MSI, sonames)
env['cantera_pure_version'] = '.'.join(str(x) for x in ctversion.version)
env['cantera_short_version'] = '.'.join(str(x) for x in ctversion.version[:2])
# Print values of all build options:
@ -1584,7 +1584,7 @@ if 'msi' in COMMAND_LINE_TARGETS:
import wxsgen
wxs = wxsgen.WxsGenerator(env['stage_dir'],
short_version=env['cantera_short_version'],
full_version=env['cantera_msi_version'],
full_version=env['cantera_pure_version'],
x64=env['TARGET_ARCH']=='amd64',
includeMatlab=env['matlab_toolbox']=='y')
wxs.make_wxs(str(target[0]))

View file

@ -57,8 +57,15 @@ if localenv['layout'] != 'debian':
else:
sharedName = '../lib/cantera'
lib = build(localenv.SharedLibrary(sharedName, libraryTargets,
SPAWN=getSpawn(localenv)))
install('$inst_libdir', lib)
if StrictVersion(SCons.__version__) >= StrictVersion('2.4.0'):
# InstallVersionedLib only fully functional in SCons >= 2.4.0
lib = build(localenv.SharedLibrary(sharedName, libraryTargets,
SPAWN=getSpawn(localenv),
SHLIBVERSION=localenv['cantera_pure_version']))
install(localenv.InstallVersionedLib, '$inst_libdir', lib)
else:
lib = build(localenv.SharedLibrary(sharedName, libraryTargets,
SPAWN=getSpawn(localenv)))
install('$inst_libdir', lib)
env['cantera_shlib'] = lib
localenv.Depends(lib, localenv['config_h_target'])