// This method is called when opCpp is finished with it's thread. void opCppFinished(bool bErrored) { runthread = null; if (!bErrored) { bCompileCpp = true; if (mode == CompileMode.BuildSolution) { RunBuildSolution(); } else if (mode == CompileMode.DebugStart) { RunDebugStart(); } else if (mode == CompileMode.NoDebugStart) { RunNoDebugStart(); } else if (mode == CompileMode.BuildSelection) { RunBuildSelection(); } } }
// Builds the project. returncode BuildProject(Project project, bool bforce) { List <VCFile> ohfiles = FindProjectFiles(project); FilterFiles(ref ohfiles, ".oh"); List <VCFile> dohfiles = FindProjectFiles(project); FilterFiles(ref dohfiles, ".doh"); if (ohfiles.Count == 0) { return(returncode.None); } if (dohfiles.Count == 0) { return(returncode.None); } //build the active configuration name string activeconfig = ProjectActiveConfig(project); FilterActiveFiles(ref ohfiles, activeconfig); FilterActiveFiles(ref dohfiles, activeconfig); if (dohfiles.Count == 0) { return(returncode.None); } if (ohfiles.Count == 0) { return(returncode.None); } //now we want to aggregate all the files //into a list for opcpp //format: "a","b","c","d" string ohfilestring = BuildFileString(ohfiles); string oharguments = "-oh " + ohfilestring; string dohfilestring = BuildFileString(dohfiles); string doharguments = "-doh " + dohfilestring; string arguments = oharguments + " " + doharguments; // if (bverbose) // arguments += " -verbose"; if (bforce) { arguments += " -force"; } arguments += " -globmode"; //add the -gd directory argument arguments += " -gd "; arguments += "\"Generated\\" + project.Name + "\""; string workingdir = project.FileName.Substring(0, project.FileName.LastIndexOf('\\')); arguments = GetOpCppArguments() + " " + arguments; runthread = new opCppThread(GetOpCppPath(), workingdir, arguments); runthread.OnEnd += opCppFinished; runthread.OnReadLine += opCppLog; runthread.Start(); //Thread thread = new Thread(new ThreadStart()); //return returncode.None; //if (result) return(returncode.Success); //else // return returncode.Errors; }