X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c3f702506c52162aa913bdf26ba180c7107c705..d136f2abf1674cb4005473509e52ef5e070cb3a0:/build/tools/builder.py diff --git a/build/tools/builder.py b/build/tools/builder.py index 635c5ae46b..4087cf53b3 100755 --- a/build/tools/builder.py +++ b/build/tools/builder.py @@ -88,50 +88,50 @@ class Builder: return self.name - def clean(self, dir=None, projectFile=None, options=None): + def getProjectFileArg(self, projectFile = None): + result = [] + if projectFile: + result.append(projectFile) + return result + + def clean(self, dir=None, projectFile=None, options=[]): """ dir = the directory containing the project file projectFile = Some formats need to explicitly specify the project file's name """ if self.isAvailable(): - if options: - optionList = list(options) - else: - optionList = [] - - optionList.insert(0, self.getProgramPath()) - optionList.append("clean") + args = [self.getProgramPath()] + args.extend(self.getProjectFileArg(projectFile)) + args.append("clean") + args.extend(options) - result = runInDir(optionList, dir) + result = runInDir(args, dir) return result return False - def configure(self, options=None): + def configure(self, dir=None, options=[]): # if we don't have configure, just report success - return True + return 0 - def build(self, dir=None, projectFile=None, targets=None, options=None): + def build(self, dir=None, projectFile=None, targets=None, options=[]): if self.isAvailable(): - if options: - optionList = list(options) - else: - optionList = [] + args = [self.getProgramPath()] + args.extend(self.getProjectFileArg(projectFile)) + args.extend(options) - optionList.insert(0, self.getProgramPath()) - - result = runInDir(optionList, dir) + result = runInDir(args, dir) return result return 1 - def install(self, dir=None, options=None): + def install(self, dir=None, projectFile=None, options=[]): if self.isAvailable(): - - args = ["make", "install"] - if options: - args.extend(options) + args = [self.getProgramPath()] + args.extend(self.getProjectFileArg(projectFile)) + args.append("install") + args.extend(options) result = runInDir(args, dir) return result @@ -197,6 +197,13 @@ class MSVCBuilder(Builder): return True return False + def getProjectFileArg(self, projectFile = None): + result = [] + if projectFile: + result.extend(['-f', projectFile]) + + return result + class MSVCProjectBuilder(Builder): def __init__(self):