~ubuntu-branches/ubuntu/trusty/xiphos/trusty

« back to all changes in this revision

Viewing changes to wafadmin/Tools/winres.py

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs, Dmitrijs Ledkovs
  • Date: 2012-03-11 18:43:32 UTC
  • mfrom: (17.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120311184332-splq3ecpx7tyi87d
Tags: 3.1.5+dfsg-1
[ Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> ]  
* New upstream release.
* Build using webkit backend
* Contains unpacked source for waf binary (Closes: #654511)
* Update debian/copyright to latest specification

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
# encoding: utf-8
 
3
 
 
4
import os,sys,re
 
5
import TaskGen,Task
 
6
from Utils import quote_whitespace
 
7
from TaskGen import extension
 
8
EXT_WINRC=['.rc']
 
9
winrc_str='${WINRC} ${_CPPDEFFLAGS} ${_CCDEFFLAGS} ${WINRCFLAGS} ${_CPPINCFLAGS} ${_CCINCFLAGS} ${WINRC_TGT_F} ${TGT} ${WINRC_SRC_F} ${SRC}'
 
10
def rc_file(self,node):
 
11
        obj_ext='.rc.o'
 
12
        if self.env['WINRC_TGT_F']=='/fo':obj_ext='.res'
 
13
        rctask=self.create_task('winrc',node,node.change_ext(obj_ext))
 
14
        self.compiled_tasks.append(rctask)
 
15
Task.simple_task_type('winrc',winrc_str,color='BLUE',before='cc cxx',shell=False)
 
16
def detect(conf):
 
17
        v=conf.env
 
18
        winrc=v['WINRC']
 
19
        v['WINRC_TGT_F']='-o'
 
20
        v['WINRC_SRC_F']='-i'
 
21
        if not winrc:
 
22
                if v['CC_NAME']in['gcc','cc','g++','c++']:
 
23
                        winrc=conf.find_program('windres',var='WINRC',path_list=v['PATH'])
 
24
                elif v['CC_NAME']=='msvc':
 
25
                        winrc=conf.find_program('RC',var='WINRC',path_list=v['PATH'])
 
26
                        v['WINRC_TGT_F']='/fo'
 
27
                        v['WINRC_SRC_F']=''
 
28
        if not winrc:
 
29
                conf.fatal('winrc was not found!')
 
30
        v['WINRCFLAGS']=''
 
31
 
 
32
extension(EXT_WINRC)(rc_file)