clang.py 623 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. # Krzysztof Kosiński 2014
  4. """
  5. Detect the Clang C compiler
  6. """
  7. from waflib.Tools import ccroot, ar, gcc
  8. from waflib.Configure import conf
  9. @conf
  10. def find_clang(conf):
  11. """
  12. Finds the program clang and executes it to ensure it really is clang
  13. """
  14. cc = conf.find_program('clang', var='CC')
  15. conf.get_cc_version(cc, clang=True)
  16. conf.env.CC_NAME = 'clang'
  17. def configure(conf):
  18. conf.find_clang()
  19. conf.find_program(['llvm-ar', 'ar'], var='AR')
  20. conf.find_ar()
  21. conf.gcc_common_flags()
  22. conf.gcc_modifier_platform()
  23. conf.cc_load_tools()
  24. conf.cc_add_flags()
  25. conf.link_add_flags()