Advertisement
Rapptz

Untitled

May 28th, 2014
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. -- create a new ninja file
  2. file = ninja.new('build.ninja')
  3.  
  4. --[[
  5. command line parsing e.g.
  6. shogun --cxx=clang++
  7. would make this cxx variable return
  8. clang++ and if it doesn't exist then
  9. g++ will be returned
  10. --]]
  11. cxx = shogun.get('cxx', 'g++')
  12.  
  13. -- same thing, except --debug would lead to true if passed,
  14. -- false otherwise.
  15. debug = shogun.get('debug', false)
  16. lto = shogun.get('lto', false)
  17.  
  18. -- write the two variables to the ninja file
  19. file.variable('ninja_required_version', '1.3')
  20. file.variable('builddir', 'obj')
  21.  
  22. -- shogun.includes(compiler, directories)
  23. -- creates a generic way of handling include files
  24. -- from MSVC, Clang, or GCC.
  25. include_directories = shogun.includes(cxx, { 'gears', '.' })
  26.  
  27. -- etc..
  28. -- many more functions in shogun that are compiler
  29. -- agnostic/generic to abstract away compiler choice
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement