Skip to content

Commit

Permalink
[SCons] Make versioning of cantera_shared optional
Browse files Browse the repository at this point in the history
Also, disable by default on MinGW to work around a SCons bug
  • Loading branch information
speth committed Nov 26, 2016
1 parent 1e87756 commit d7819af
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 16 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ if env['OS'] in ('Windows', 'Darwin'):
else:
defaults.threadFlags = '-pthread'

# InstallVersionedLib only fully functional in SCons >= 2.4.0
# SHLIBVERSION fails with MinGW: http://scons.tigris.org/issues/show_bug.cgi?id=3035
if (env['toolchain'] == 'mingw'
or StrictVersion(SCons.__version__) < StrictVersion('2.4.0')):
defaults.versionedSharedLibrary = False
else:
defaults.versionedSharedLibrary = True

defaults.fsLayout = 'compact' if env['OS'] == 'Windows' else 'standard'
defaults.env_vars = 'LD_LIBRARY_PATH,PYTHONPATH'

Expand Down Expand Up @@ -557,6 +565,14 @@ config_options = [
static libraries and avoids a bug with using valgrind with
the -static linking flag.""",
True),
BoolVariable(
'versioned_shared_library',
"""If enabled, create a versioned shared library, with symlinks to the
more generic library name, e.g. libcantera_shared.so.2.3.0 as the
actual library and libcantera_shared.so and libcantera_shared.so.2
as symlinks.
""",
defaults.versionedSharedLibrary),
EnumVariable(
'layout',
"""The layout of the directory structure. 'standard' installs files to
Expand Down
3 changes: 1 addition & 2 deletions src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ if localenv['layout'] != 'debian':
else:
sharedName = '../lib/cantera'

if StrictVersion(SCons.__version__) >= StrictVersion('2.4.0'):
# InstallVersionedLib only fully functional in SCons >= 2.4.0
if localenv['versioned_shared_library']:
lib = build(localenv.SharedLibrary(sharedName, libraryTargets,
SPAWN=getSpawn(localenv),
SHLIBVERSION=localenv['cantera_pure_version']))
Expand Down

0 comments on commit d7819af

Please sign in to comment.