python bindings install target works. libhammer.so must be on LD_LIBRARY_PATH.
This commit is contained in:
parent
20bf8c4b79
commit
79f498cdab
2 changed files with 11 additions and 19 deletions
14
SConstruct
14
SConstruct
|
|
@ -95,9 +95,15 @@ env["ENV"].update(x for x in os.environ.items() if x[0].startswith("CCC_"))
|
|||
#env.Append(CPPPATH=os.path.join('#', "hammer"))
|
||||
|
||||
testruns = []
|
||||
targets = ["$libpath",
|
||||
"$incpath",
|
||||
"$parsersincpath",
|
||||
"$backendsincpath",
|
||||
"$pkgconfigpath"]
|
||||
|
||||
Export('env')
|
||||
Export('testruns')
|
||||
Export('targets')
|
||||
|
||||
if not GetOption("in_place"):
|
||||
env['BUILD_BASE'] = 'build/$VARIANT'
|
||||
|
|
@ -108,12 +114,6 @@ else:
|
|||
lib = env.SConscript(["src/SConscript"])
|
||||
env.Alias(env.SConscript(["examples/SConscript"]))
|
||||
|
||||
#env.Command('test', '$BUILD_BASE/src/test_suite', 'env LD_LIBRARY_PATH=$BUILD_BASE/src $SOURCE')
|
||||
|
||||
env.Alias("test", testruns)
|
||||
|
||||
env.Alias("install", "$libpath")
|
||||
env.Alias("install", "$incpath")
|
||||
env.Alias("install", "$parsersincpath")
|
||||
env.Alias("install", "$backendsincpath")
|
||||
env.Alias("install", "$pkgconfigpath")
|
||||
env.Alias("install", targets)
|
||||
|
|
|
|||
|
|
@ -1,22 +1,12 @@
|
|||
# -*- python -*-
|
||||
import os, os.path
|
||||
Import('env libhammer_shared testruns')
|
||||
Import('env libhammer_shared testruns targets')
|
||||
|
||||
pythonenv = env.Clone(IMPLICIT_COMMAND_DEPENDENCIES = 0)
|
||||
|
||||
#pythonenv.Append(CPPPATH = ['../../'])
|
||||
#pythonenv.Append(CCFLAGS = ['-fpic', '-DSWIG', '-Wno-all', '-Wno-extra', '-Wno-error'])
|
||||
#pythonenv.ParseConfig("pkg-config --cflags python")
|
||||
#pythonenv.Append(LIBS = ['hammer'])
|
||||
#pythonenv.Append(LIBPATH = ['../../'])
|
||||
#pythonenv.Append(SWIGFLAGS = ['-DHAMMER_INTERNAL__NO_STDARG_H', '-Isrc/', '-python'])
|
||||
|
||||
|
||||
|
||||
swig = pythonenv.Command("hammer.i", "../swig/hammer.i", Copy("$TARGET", "$SOURCE"))
|
||||
setup = ['setup.py']
|
||||
pydir = os.path.join(env['BUILD_BASE'], 'src/bindings/python')
|
||||
#libhammer_python = pythonenv.SharedLibrary('hammer', swig, SHLIBPREFIX='_')
|
||||
libhammer_python = pythonenv.Command(['hammer.py', 'hammer_wrap.c'], [swig, setup], 'python ' + os.path.join(pydir, 'setup.py') + ' build_ext --inplace')
|
||||
Default(libhammer_python)
|
||||
|
||||
|
|
@ -28,4 +18,6 @@ pytest = Alias("testpython", [pytestexec], pytestexec)
|
|||
AlwaysBuild(pytest)
|
||||
testruns.append(pytest)
|
||||
|
||||
|
||||
pyinstallexec = pythonenv.Command(None, libhammer_python, 'python ' + os.path.join(pydir, 'setup.py ') + ' install')
|
||||
pyinstall = Alias("installpython", [pyinstallexec], pyinstallexec)
|
||||
targets.append(pyinstall)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue