2013-11-17 20:26:51 -06:00
|
|
|
# -*- python -*-
|
2013-11-19 17:26:01 -06:00
|
|
|
import os.path
|
|
|
|
|
Import('env libhammer_shared')
|
2013-11-17 20:26:51 -06:00
|
|
|
|
2013-11-17 20:56:03 -06:00
|
|
|
pythonenv = env.Clone(IMPLICIT_COMMAND_DEPENDENCIES = 0)
|
2013-11-17 20:26:51 -06:00
|
|
|
|
|
|
|
|
pythonenv.Append(CPPPATH = ['../../', '/usr/include/python2.7'])
|
|
|
|
|
pythonenv.Append(CCFLAGS = ['-fpic', '-DSWIG', '-Wno-all', '-Wno-extra', '-Wno-error'])
|
2013-11-19 19:00:58 -06:00
|
|
|
pythonenv.Append(LIBS = ['hammer'])
|
|
|
|
|
pythonenv.Append(LIBPATH = ['../../'])
|
2013-11-17 20:26:51 -06:00
|
|
|
pythonenv.Append(SWIGFLAGS = ['-DHAMMER_INTERNAL__NO_STDARG_H', '-Isrc/', '-python'])
|
|
|
|
|
|
|
|
|
|
pythonenv.Command("hammer.i", "../swig/hammer.i", Copy("$TARGET", "$SOURCE"))
|
|
|
|
|
|
|
|
|
|
swig = ['hammer.i']
|
|
|
|
|
|
2013-11-19 19:00:58 -06:00
|
|
|
libhammer_python = pythonenv.SharedLibrary('hammer', swig, SHLIBPREFIX='_')
|
2013-11-18 21:14:44 -06:00
|
|
|
|
|
|
|
|
pytestenv = pythonenv.Clone()
|
2013-11-19 17:26:01 -06:00
|
|
|
pytestenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0]))
|
2013-11-23 19:53:58 -06:00
|
|
|
pytestenv.Command(None, ['hammer_tests.py'] + libhammer_python, "nosetests -vv $SOURCE")
|
2013-11-19 02:41:45 -06:00
|
|
|
|
|
|
|
|
Clean('.', ['hammer.pyc', 'hammer_tests.py', 'hammer_tests.pyc'])
|