#NEWLINE# def generate_pch_rule_for( self , langname , compiler , qstr , is_cross , outfile ) : #NEWLINE# #INDENT# if ( ( langname != 'c' ) and ( langname != 'cpp' ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if is_cross : #NEWLINE# #INDENT# crstr = '_CROSS' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# crstr = '' #NEWLINE# #UNINDENT# rule = ( 'rule %s%s_PCH\n' % ( langname , crstr ) ) #NEWLINE# depargs = compiler . get_dependency_gen_args ( '$out' , '$DEPFILE' ) #NEWLINE# cross_args = [ ] #NEWLINE# if is_cross : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# cross_args = self . environment . cross_info . config [ 'properties' ] [ ( langname + '_args' ) ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# quoted_depargs = [ ] #NEWLINE# for d in depargs : #NEWLINE# #INDENT# if ( ( d != '$out' ) and ( d != '$in' ) ) : #NEWLINE# #INDENT# d = ( qstr % d ) #NEWLINE# #UNINDENT# quoted_depargs . append ( d ) #NEWLINE# #UNINDENT# if ( compiler . get_id ( ) == 'msvc' ) : #NEWLINE# #INDENT# output = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# output = ' ' . join ( compiler . get_output_args ( '$out' ) ) #NEWLINE# #UNINDENT# command = ( ' command = %s %s $ARGS %s %s %s $in\n' % ( ' ' . join ( compiler . get_exelist ( ) ) , ' ' . join ( cross_args ) , ' ' . join ( quoted_depargs ) , outfile , ' ' . join ( compiler . get_compile_only_args ( ) ) ) ) #NEWLINE# description = ( ' description = Precompiling header %s\n' % '$in' ) #NEWLINE# if ( compiler . get_id ( ) == 'msvc' ) : #NEWLINE# #INDENT# deps = ' deps = msvc\n' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# deps = ' deps = gcc\n' #NEWLINE# deps += ' depfile = $DEPFILE\n' #NEWLINE# #UNINDENT# outfile . write ( rule ) #NEWLINE# outfile . write ( command ) #NEWLINE# outfile . write ( deps ) #NEWLINE# outfile . write ( description ) #NEWLINE# outfile . write ( '\n' )