#NEWLINE# def generate( self , interp ) : #NEWLINE# #INDENT# self . interpreter = interp #NEWLINE# outfilename = os . path . join ( self . environment . get_build_dir ( ) , self . ninja_filename ) #NEWLINE# tempfilename = ( outfilename + '~' ) #NEWLINE# outfile = open ( tempfilename , 'w' ) #NEWLINE# outfile . write ( ( '# This is the build file for project "%s"\n' % self . build . get_project ( ) ) ) #NEWLINE# outfile . write ( '# It is autogenerated by the Meson build system.\n' ) #NEWLINE# outfile . write ( '# Do not edit by hand.\n\n' ) #NEWLINE# outfile . write ( 'ninja_required_version = 1.5.1\n\n' ) #NEWLINE# outfile = self . detect_vs_dep_prefix ( outfile , tempfilename ) #NEWLINE# self . generate_rules ( outfile ) #NEWLINE# self . generate_phony ( outfile ) #NEWLINE# outfile . write ( '# Build rules for targets\n\n' ) #NEWLINE# [ self . generate_target ( t , outfile ) for t in self . build . get_targets ( ) . values ( ) ] #NEWLINE# if ( len ( self . build . pot ) > 0 ) : #NEWLINE# #INDENT# outfile . write ( '# Build rules for localisation.\n\n' ) #NEWLINE# self . generate_po ( outfile ) #NEWLINE# #UNINDENT# outfile . write ( '# Test rules\n\n' ) #NEWLINE# self . generate_tests ( outfile ) #NEWLINE# outfile . write ( '# Install rules\n\n' ) #NEWLINE# self . generate_install ( outfile ) #NEWLINE# if ( ( 'b_coverage' in self . environment . coredata . base_options ) and self . environment . coredata . base_options [ 'b_coverage' ] . value ) : #NEWLINE# #INDENT# outfile . write ( '# Coverage rules\n\n' ) #NEWLINE# self . generate_coverage_rules ( t ) #NEWLINE# #UNINDENT# outfile . write ( '# Suffix\n\n' ) #NEWLINE# self . generate_ending ( outfile ) #NEWLINE# outfile . close ( ) #NEWLINE# os . replace ( tempfilename , outfilename ) #NEWLINE# self . generate_compdb ( )