#NEWLINE# def generate( self , projectName , targetPath ) : #NEWLINE# #INDENT# tempPath = tempfile . mkdtemp ( ) #NEWLINE# try : #NEWLINE# #INDENT# build = self . project . platform . createBuild ( self . config , self . library , projectName , self . name ) #NEWLINE# if ( ( 'c++' in self . getLanguages ( ) ) or ( self . config . get ( 'language' , 'c' ) == 'c++' ) ) : #NEWLINE# #INDENT# tracerSourceName = 'tracer_gen.cpp' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# tracerSourceName = 'tracer_gen.c' #NEWLINE# self . library . language = 'c' #NEWLINE# #UNINDENT# tracerSourcePath = os . path . join ( tempPath , tracerSourceName ) #NEWLINE# g = Generator . PassthroughTracerGenerator ( self . config , self . project . platform , [ self . library ] , templatePath = Resource . getPath ( 'templates' ) ) #NEWLINE# output = open ( tracerSourcePath , 'w' ) #NEWLINE# g . generate ( outputFile = output ) #NEWLINE# output . close ( ) #NEWLINE# self . addSourceFile ( tracerSourcePath ) #NEWLINE# build . compile ( targetPath = targetPath ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# shutil . rmtree ( tempPath ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# Log . warn ( ( "Unable to clean up temporary directory '%s'" % tempPath ) )