clangxx.py 648 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy 2009-2018 (ita)
  4. """
  5. Detect the Clang++ C++ compiler
  6. """
  7. from waflib.Tools import ccroot, ar, gxx
  8. from waflib.Configure import conf
  9. @conf
  10. def find_clangxx(conf):
  11. """
  12. Finds the program clang++, and executes it to ensure it really is clang++
  13. """
  14. cxx = conf.find_program('clang++', var='CXX')
  15. conf.get_cc_version(cxx, clang=True)
  16. conf.env.CXX_NAME = 'clang'
  17. def configure(conf):
  18. conf.find_clangxx()
  19. conf.find_program(['llvm-ar', 'ar'], var='AR')
  20. conf.find_ar()
  21. conf.gxx_common_flags()
  22. conf.gxx_modifier_platform()
  23. conf.cxx_load_tools()
  24. conf.cxx_add_flags()
  25. conf.link_add_flags()