~elementary-apps/noise/trunk

« back to all changes in this revision

Viewing changes to .waf-1.6.2-ad4cc42bd7d347f7e283789e711b993f/waflib/Tools/winres.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,re
 
6
from waflib import TaskGen,Task
 
7
from waflib.TaskGen import extension
 
8
def rc_file(self,node):
 
9
        obj_ext='.rc.o'
 
10
        if self.env['WINRC_TGT_F']=='/fo':
 
11
                obj_ext='.res'
 
12
        rctask=self.create_task('winrc',node,node.change_ext(obj_ext))
 
13
        self.compiled_tasks.append(rctask)
 
14
class winrc(Task.Task):
 
15
        run_str='${WINRC} ${WINRCFLAGS} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${WINRC_TGT_F} ${TGT} ${WINRC_SRC_F} ${SRC}'
 
16
        color='BLUE'
 
17
def configure(conf):
 
18
        v=conf.env
 
19
        v['WINRC_TGT_F']='-o'
 
20
        v['WINRC_SRC_F']='-i'
 
21
        if not conf.env.WINRC:
 
22
                if v.CC_NAME=='msvc':
 
23
                        winrc=conf.find_program('RC',var='WINRC',path_list=v['PATH'])
 
24
                        v['WINRC_TGT_F']='/fo'
 
25
                        v['WINRC_SRC_F']=''
 
26
                else:
 
27
                        winrc=conf.find_program('windres',var='WINRC',path_list=v['PATH'])
 
28
        if not conf.env.WINRC:
 
29
                conf.fatal('winrc was not found!')
 
30
        v['WINRCFLAGS']=[]
 
31
 
 
32
extension('.rc')(rc_file)
 
 
b'\\ No newline at end of file'