source: waflib/Tools/compiler_d.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.4 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 import Utils,Configure,Options,Logs
7d_compiler={'default':['gdc','dmd','ldc2']}
8def default_compilers():
9        build_platform=Utils.unversioned_sys_platform()
10        possible_compiler_list=d_compiler.get(build_platform,d_compiler['default'])
11        return' '.join(possible_compiler_list)
12def configure(conf):
13        try:test_for_compiler=conf.options.check_d_compiler or default_compilers()
14        except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_d')")
15        for compiler in re.split('[ ,]+',test_for_compiler):
16                conf.env.stash()
17                conf.start_msg('Checking for %r (D compiler)'%compiler)
18                try:
19                        conf.load(compiler)
20                except conf.errors.ConfigurationError ,e:
21                        conf.env.revert()
22                        conf.end_msg(False)
23                        Logs.debug('compiler_d: %r'%e)
24                else:
25                        if conf.env.D:
26                                conf.end_msg(conf.env.get_flat('D'))
27                                conf.env['COMPILER_D']=compiler
28                                break
29                        conf.end_msg(False)
30        else:
31                conf.fatal('could not configure a D compiler!')
32def options(opt):
33        test_for_compiler=default_compilers()
34        d_compiler_opts=opt.add_option_group('Configuration options')
35        d_compiler_opts.add_option('--check-d-compiler',default=None,help='list of D compilers to try [%s]'%test_for_compiler,dest='check_d_compiler')
36        for x in test_for_compiler.split():
37                opt.load('%s'%x)
Note: See TracBrowser for help on using the repository browser.