Build a static version of clib to use with Python on Linux
This commit is contained in:
parent
c3f4972f52
commit
d8529fea15
2 changed files with 19 additions and 8 deletions
|
|
@ -3,11 +3,18 @@ from buildutils import *
|
|||
Import('env', 'buildTargets', 'installTargets')
|
||||
|
||||
localenv = env.Clone()
|
||||
lib = localenv.SharedLibrary(pjoin('../../lib', 'clib'),
|
||||
source=mglob(localenv, 'src', 'cpp'),
|
||||
LIBS=env['cantera_libs'])
|
||||
env['clib_shared'] = lib
|
||||
|
||||
inst = localenv.Install('$ct_libdir', lib)
|
||||
buildTargets.extend(lib)
|
||||
installTargets.extend(inst)
|
||||
if localenv['OS'] == 'Windows':
|
||||
lib = localenv.SharedLibrary(pjoin('../../lib', 'clib'),
|
||||
source=mglob(localenv, 'src', 'cpp'),
|
||||
LIBS=env['cantera_libs'])
|
||||
env['clib_shared'] = lib
|
||||
inst = localenv.Install('$ct_libdir', lib)
|
||||
buildTargets.extend(lib)
|
||||
installTargets.extend(inst)
|
||||
|
||||
static_lib = localenv.Library(pjoin('../../lib', 'clib'),
|
||||
source=mglob(localenv, 'src', 'cpp'))
|
||||
inst_static = localenv.Install('$ct_libdir', static_lib)
|
||||
buildTargets.extend(static_lib)
|
||||
installTargets.extend(inst_static)
|
||||
|
|
|
|||
|
|
@ -17,8 +17,12 @@ if localenv['OS'] == 'Windows':
|
|||
make_setup = localenv.SubstFile('setup.py', 'setup.py.in')
|
||||
|
||||
if env['python_package'] == 'full':
|
||||
libs = ['clib']
|
||||
if localenv['OS'] != 'Windows':
|
||||
libs.extend(env['cantera_libs'])
|
||||
|
||||
pymodule = localenv.SharedLibrary('Cantera/_cantera', ['src/pycantera.cpp'],
|
||||
LIBS='clib',
|
||||
LIBS=libs,
|
||||
SHLIBPREFIX='',
|
||||
SHLIBSUFFIX=gcv('SO'))
|
||||
buildTargets.extend(pymodule)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue