~elementary-apps/noise/trunk

« back to all changes in this revision

Viewing changes to .waf-1.6.2-ad4cc42bd7d347f7e283789e711b993f/waflib/Tools/compiler_d.py

  • Committer: Scott Ringwelski
  • Date: 2011-02-10 21:30:53 UTC
  • Revision ID: sgringwe@mtu.edu-20110210213053-d3c7mnexeref3cwj
sexy icons, sexy waf

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
# encoding: utf-8
 
3
# WARNING! All changes made to this file will be lost!
 
4
 
 
5
import os,sys,imp,types
 
6
from waflib import Utils,Configure,Options,Logs
 
7
def configure(conf):
 
8
        for compiler in conf.options.dcheck.split(','):
 
9
                conf.env.stash()
 
10
                conf.start_msg('Checking for %r (d compiler)'%compiler)
 
11
                try:
 
12
                        conf.load(compiler)
 
13
                except conf.errors.ConfigurationError ,e:
 
14
                        conf.env.revert()
 
15
                        conf.end_msg(False)
 
16
                        Logs.debug('compiler_cxx: %r'%e)
 
17
                else:
 
18
                        if conf.env.D:
 
19
                                conf.end_msg(True)
 
20
                                conf.env['COMPILER_D']=compiler
 
21
                                conf.env.D_COMPILER=conf.env.D
 
22
                                break
 
23
                        conf.end_msg(False)
 
24
        else:
 
25
                conf.fatal('no suitable d compiler was found')
 
26
def options(opt):
 
27
        d_compiler_opts=opt.add_option_group('D Compiler Options')
 
28
        d_compiler_opts.add_option('--check-d-compiler',default='gdc,dmd',action='store',help='check for the compiler [Default:gdc,dmd]',dest='dcheck')
 
29
        for d_compiler in['gdc','dmd']:
 
30
                opt.load('%s'%d_compiler)