Added new SConscript-based build system; not yet done porting
This commit is contained in:
parent
ce74cf7939
commit
e9a7c0b83d
3 changed files with 98 additions and 0 deletions
30
SConstruct
Normal file
30
SConstruct
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
env = Environment()
|
||||
|
||||
env.MergeFlags("-std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attributes")
|
||||
env['MODE'] = 'shared'
|
||||
|
||||
AddOption("--variant",
|
||||
dest="variant",
|
||||
nargs=1, type="choice",
|
||||
choices=["debug", "opt"],
|
||||
default="debug",
|
||||
action="store",
|
||||
help="Build variant (debug or opt)")
|
||||
|
||||
env['BUILDDIR'] = 'build/$VARIANT'
|
||||
|
||||
dbg = env.Clone(VARIANT='debug')
|
||||
dbg.Append(CCFLAGS=['-g'])
|
||||
|
||||
opt = env.Clone(VARIANT='opt')
|
||||
opt.Append(CCFLAGS="-O3")
|
||||
|
||||
if GetOption("variant") == 'debug':
|
||||
env = dbg
|
||||
else:
|
||||
env = opt
|
||||
Export('env')
|
||||
|
||||
env.SConscript(["src/SConscript"], variant_dir='build/$VARIANT/src')
|
||||
env.SConscript(["examples/SConscript"], variant_dir='build/$VARIANT/examples')
|
||||
Loading…
Add table
Add a link
Reference in a new issue