SConstruct 434 B

1234567891011121314151617181920212223242526
  1. def ParseOptions():
  2. AddOption('--mode',
  3. dest='mode',
  4. type='string',
  5. nargs=1,
  6. action='store',
  7. default='dbg',
  8. help='build in dbg or opt mode')
  9. env = DefaultEnvironment()
  10. ParseOptions()
  11. env['mode'] = GetOption('mode')
  12. if env['mode'] == 'dbg':
  13. env.Append(CCFLAGS='-g')
  14. else:
  15. env.Append(CCFLAGS='-O2 -g')
  16. env.Append(CPPPATH=Dir(env['mode']).abspath)
  17. Export('env')
  18. SConscript('src/SConscript', build_dir=env['mode'])