File: compiler_d.py

package info (click to toggle)
hotssh 0.2.6%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,140 kB
  • ctags: 1,373
  • sloc: python: 11,679; makefile: 45; sh: 5; csh: 2
file content (23 lines) | stat: -rw-r--r-- 847 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/env python
# encoding: utf-8

import os,sys,imp,types
import Utils,Configure,Options
def detect(conf):
	if getattr(Options.options,'check_dmd_first',None):
		test_for_compiler=['dmd','gdc']
	else:
		test_for_compiler=['gdc','dmd']
	for d_compiler in test_for_compiler:
		conf.check_tool(d_compiler)
		if conf.env['D_COMPILER']:
			conf.check_message("%s"%d_compiler,'',True)
			conf.env["COMPILER_D"]=d_compiler
			return
		conf.check_message("%s"%d_compiler,'',False)
def set_options(opt):
	d_compiler_opts=opt.add_option_group("D Compiler Options")
	d_compiler_opts.add_option('--check-dmd-first',action="store_true",help='checks for the gdc compiler before dmd (default is the other way round)',dest='check_dmd_first',default=False)
	for d_compiler in['gdc','dmd']:
		opt.tool_options('%s'%d_compiler,option_group=d_compiler_opts)