File: winres.py

package info (click to toggle)
xmms2 0.8%2Bdfsg-12
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 12,388 kB
  • ctags: 16,835
  • sloc: ansic: 63,792; python: 12,801; cpp: 5,718; xml: 1,479; perl: 338; ruby: 243; makefile: 82; sh: 59; asm: 7
file content (34 lines) | stat: -rw-r--r-- 1,037 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
24
25
26
27
28
29
30
31
32
33
34
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file

from waflib import Task
from waflib.TaskGen import extension
def rc_file(self,node):
	obj_ext='.rc.o'
	if self.env['WINRC_TGT_F']=='/fo':
		obj_ext='.res'
	rctask=self.create_task('winrc',node,node.change_ext(obj_ext))
	try:
		self.compiled_tasks.append(rctask)
	except AttributeError:
		self.compiled_tasks=[rctask]
class winrc(Task.Task):
	run_str='${WINRC} ${WINRCFLAGS} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${WINRC_TGT_F} ${TGT} ${WINRC_SRC_F} ${SRC}'
	color='BLUE'
def configure(conf):
	v=conf.env
	v['WINRC_TGT_F']='-o'
	v['WINRC_SRC_F']='-i'
	if not conf.env.WINRC:
		if v.CC_NAME=='msvc':
			conf.find_program('RC',var='WINRC',path_list=v['PATH'])
			v['WINRC_TGT_F']='/fo'
			v['WINRC_SRC_F']=''
		else:
			conf.find_program('windres',var='WINRC',path_list=v['PATH'])
	if not conf.env.WINRC:
		conf.fatal('winrc was not found!')
	v['WINRCFLAGS']=[]

extension('.rc')(rc_file)