def build_nt(solution_name): vcbuild_opts = [ solution_name, '/nologo', # leave out the MS copyright message '/showenv', '/time', #'/MP', # TODO: multicore compilation doesn't seem to be working :[ ] if 'rebuild' in sys.argv: vcbuild_opts.append('/rebuild') if 'pgooptimize' in sys.argv: config = 'PGOOptimize' elif 'pgoinstrument' in sys.argv: config = 'PGOInstrument' elif DEBUG: config = 'Debug' else: config = 'Release' platform = 'Win32' run('vcbuild %s "%s|%s"' % (' '.join(vcbuild_opts), config, platform))
def bakefile(project_name, makefile, outputdir = None): # First, create the BKL file which will tell bakefile how to create platform # specific makefiles. bkl = project_name + '.bkl' write_xml(makefile, bkl) # TODO: support more formats here formats = [('msvs2008prj', '%s.sln' % project_name)] # create Bakefiles.bkgen write_xml(bakefile_gen(bkl, formats), 'Bakefiles.bkgen') # Bakefile needs to be told the locations of some .bkl files we need-- # 1) wx.bkl (and related files) # 2) wxpy-settings.bkl, which will provide a template for all wxpy based extensions bakefile_paths = [WXWIN / 'build/bakefiles/wxpresets', path(__file__).parent] os.environ.update(WXWIN = WXWIN, BAKEFILE_PATHS = os.pathsep.join(bakefile_paths)) # define extra variables that are passed to bakefile_gen with -D bakefile_vars = dict( WXPY_PYDEBUG = '1' if DEBUG else '0', # link against python25_d.dll ) bakefile_vars_str = ' '.join('-D %s=%s' % (key, value) for key, value in bakefile_vars.iteritems()) # This results in Makefile (autotools), SLN (Visual Studio), or other # platform specific files. run('bakefile_gen' + (' -V' if BAKEFILES_VERBOSE else '') + ' ' + bakefile_vars_str) if len(formats) > 1: raise AssertionError('figure out a better way to8return the name of the sln') return formats[0][1]