source: waflib/Tools/compiler_cxx.py @ 904702d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 904702d was 904702d, checked in by Paul Brossier <piem@piem.org>, 9 years ago

waf, waflib: update to 1.8.7

  • Property mode set to 100644
File size: 1.8 KB
Line 
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
5import os,sys,imp,types,re
6from waflib.Tools import ccroot
7from waflib import Utils,Configure
8from waflib.Logs import debug
9cxx_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++']}
10def 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)
14def 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!')
34def 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)
Note: See TracBrowser for help on using the repository browser.