SConstruct 607 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. env = DefaultEnvironment()
  2. def ParseOptions():
  3. AddOption('--opt',
  4. dest='opt',
  5. action='store_true',
  6. default='false',
  7. help='build in opt mode, default dbg mode')
  8. ParseOptions()
  9. env.Append(LIBPATH=[
  10. '/usr/local/lib'
  11. ])
  12. env.Append(LIBS=[
  13. 'gflags',
  14. 'glog',
  15. 'gtest',
  16. 'gmock',
  17. ])
  18. if GetOption('opt') == True:
  19. env['root'] = 'opt'
  20. env.Append(CCFLAGS='-O2 -g')
  21. env.Append(LIBS='tcmalloc')
  22. else:
  23. env['root'] = 'dbg'
  24. env.Append(CCFLAGS='-g')
  25. env.Append(LIBS='tcmalloc_debug')
  26. env.Append(CPPPATH=Dir(env['root']).abspath)
  27. Export('env')
  28. SConscript('src/SConscript', variant_dir=env['root'])