Added build system for C++
This commit is contained in:
parent
94924da87e
commit
cccb5f09ec
2 changed files with 15 additions and 2 deletions
|
|
@ -29,8 +29,13 @@ else:
|
||||||
if os.getenv("CC") == "clang":
|
if os.getenv("CC") == "clang":
|
||||||
env.Replace(CC="clang",
|
env.Replace(CC="clang",
|
||||||
CXX="clang++")
|
CXX="clang++")
|
||||||
|
|
||||||
|
#rootpath = env['ROOTPATH'] = os.path.abspath('.')
|
||||||
|
#env.Append(CPPPATH=os.path.join('#', "hammer"))
|
||||||
|
|
||||||
Export('env')
|
Export('env')
|
||||||
|
|
||||||
|
|
||||||
env.SConscript(["src/SConscript"], variant_dir='build/$VARIANT/src')
|
env.SConscript(["src/SConscript"], variant_dir='build/$VARIANT/src')
|
||||||
env.SConscript(["examples/SConscript"], variant_dir='build/$VARIANT/examples')
|
env.SConscript(["examples/SConscript"], variant_dir='build/$VARIANT/examples')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
# -*- python -*-
|
# -*- python -*-
|
||||||
Import('env')
|
Import('env')
|
||||||
|
|
||||||
|
bindings = []
|
||||||
|
|
||||||
parsers = ['parsers/%s.c'%s for s in
|
parsers = ['parsers/%s.c'%s for s in
|
||||||
['action',
|
['action',
|
||||||
'and',
|
'and',
|
||||||
|
|
@ -50,11 +52,17 @@ tests = ['t_benchmark.c',
|
||||||
't_grammar.c',
|
't_grammar.c',
|
||||||
't_misc.c']
|
't_misc.c']
|
||||||
|
|
||||||
libhammer = env.SharedLibrary('hammer', parsers + backends + misc_hammer_parts)
|
libhammer_shared = env.SharedLibrary('hammer', parsers + backends + misc_hammer_parts)
|
||||||
libhammer = env.StaticLibrary('hammer', parsers + backends + misc_hammer_parts)
|
libhammer_static = env.StaticLibrary('hammer', parsers + backends + misc_hammer_parts)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
testenv = env.Clone()
|
testenv = env.Clone()
|
||||||
testenv.ParseConfig('pkg-config --cflags --libs glib-2.0')
|
testenv.ParseConfig('pkg-config --cflags --libs glib-2.0')
|
||||||
testenv.Append(LIBS=['hammer'], LIBPATH=['.'])
|
testenv.Append(LIBS=['hammer'], LIBPATH=['.'])
|
||||||
testenv.Program('test_suite', tests + ['test_suite.c'])
|
testenv.Program('test_suite', tests + ['test_suite.c'])
|
||||||
|
|
||||||
|
Export("libhammer_static libhammer_shared")
|
||||||
|
|
||||||
|
for b in bindings:
|
||||||
|
env.SConscript(["bindings/%s/SConscript" % b])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue