File: compiler_d.py

package info (click to toggle)
flowcanvas 0.7.1%2Bdfsg0-0.3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 956 kB
  • ctags: 1,754
  • sloc: python: 11,118; cpp: 3,414; makefile: 17
file content (30 lines) | stat: -rw-r--r-- 963 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /usr/bin/env python
# encoding: utf-8
# WARNING! All changes made to this file will be lost!

import os,sys,imp,types
from waflib import Utils,Configure,Options,Logs
def configure(conf):
	for compiler in conf.options.dcheck.split(','):
		conf.env.stash()
		conf.start_msg('Checking for %r (d compiler)'%compiler)
		try:
			conf.load(compiler)
		except conf.errors.ConfigurationError ,e:
			conf.env.revert()
			conf.end_msg(False)
			Logs.debug('compiler_cxx: %r'%e)
		else:
			if conf.env.D:
				conf.end_msg(True)
				conf.env['COMPILER_D']=compiler
				conf.env.D_COMPILER=conf.env.D
				break
			conf.end_msg(False)
	else:
		conf.fatal('no suitable d compiler was found')
def options(opt):
	d_compiler_opts=opt.add_option_group('D Compiler Options')
	d_compiler_opts.add_option('--check-d-compiler',default='gdc,dmd',action='store',help='check for the compiler [Default:gdc,dmd]',dest='dcheck')
	for d_compiler in['gdc','dmd']:
		opt.load('%s'%d_compiler)