1 | #! /usr/bin/env python |
---|
2 | # encoding: utf-8 |
---|
3 | # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file |
---|
4 | |
---|
5 | import os,sys,imp,types,re |
---|
6 | from waflib.Tools import ccroot |
---|
7 | from waflib import Utils,Configure |
---|
8 | from waflib.Logs import debug |
---|
9 | cxx_compiler={'win32':['msvc','g++','clang++'],'cygwin':['g++'],'darwin':['clang++','g++'],'aix':['xlc++','g++','clang++'],'linux':['g++','clang++','icpc'],'sunos':['sunc++','g++'],'irix':['g++'],'hpux':['g++'],'gnu':['g++','clang++'],'java':['g++','msvc','clang++','icpc'],'default':['g++','clang++']} |
---|
10 | def default_compilers(): |
---|
11 | build_platform=Utils.unversioned_sys_platform() |
---|
12 | possible_compiler_list=cxx_compiler.get(build_platform,cxx_compiler['default']) |
---|
13 | return' '.join(possible_compiler_list) |
---|
14 | def configure(conf): |
---|
15 | try:test_for_compiler=conf.options.check_cxx_compiler or default_compilers() |
---|
16 | except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_cxx')") |
---|
17 | for compiler in re.split('[ ,]+',test_for_compiler): |
---|
18 | conf.env.stash() |
---|
19 | conf.start_msg('Checking for %r (C++ compiler)'%compiler) |
---|
20 | try: |
---|
21 | conf.load(compiler) |
---|
22 | except conf.errors.ConfigurationError ,e: |
---|
23 | conf.env.revert() |
---|
24 | conf.end_msg(False) |
---|
25 | debug('compiler_cxx: %r'%e) |
---|
26 | else: |
---|
27 | if conf.env['CXX']: |
---|
28 | conf.end_msg(conf.env.get_flat('CXX')) |
---|
29 | conf.env['COMPILER_CXX']=compiler |
---|
30 | break |
---|
31 | conf.end_msg(False) |
---|
32 | else: |
---|
33 | conf.fatal('could not configure a C++ compiler!') |
---|
34 | def options(opt): |
---|
35 | test_for_compiler=default_compilers() |
---|
36 | opt.load_special_tools('cxx_*.py') |
---|
37 | cxx_compiler_opts=opt.add_option_group('Configuration options') |
---|
38 | cxx_compiler_opts.add_option('--check-cxx-compiler',default=None,help='list of C++ compilers to try [%s]'%test_for_compiler,dest="check_cxx_compiler") |
---|
39 | for x in test_for_compiler.split(): |
---|
40 | opt.load('%s'%x) |
---|