diff options
author | marha <marha@users.sourceforge.net> | 2009-10-02 09:28:00 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-10-02 09:28:00 +0000 |
commit | 516cdec4894096305f5002b922ba02d49cb3e816 (patch) | |
tree | e34bc97b00f6acf17b33877efb7f5ffa543d2881 /tools/mhmake/src/build.cpp | |
parent | 945c71554aa1866a5286dd4b8f5b199dd7af9be9 (diff) | |
download | vcxsrv-516cdec4894096305f5002b922ba02d49cb3e816.tar.gz vcxsrv-516cdec4894096305f5002b922ba02d49cb3e816.tar.bz2 vcxsrv-516cdec4894096305f5002b922ba02d49cb3e816.zip |
Optimised auto dependency generation
Added control c handler in windows
Now throw string exceptions instead of integer exceptions.
Diffstat (limited to 'tools/mhmake/src/build.cpp')
-rw-r--r-- | tools/mhmake/src/build.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/tools/mhmake/src/build.cpp b/tools/mhmake/src/build.cpp index 97366d88a..3d31b4605 100644 --- a/tools/mhmake/src/build.cpp +++ b/tools/mhmake/src/build.cpp @@ -287,8 +287,7 @@ found: int CommandLen=FullCommand.size();
if (CommandLen>Len-1)
{
- cerr << "Fatal error: Command to long: "<<FullCommand<<endl;
- throw(1);
+ throw string("Command to long: ") + FullCommand;
}
strcpy(szFullCommand,FullCommand.c_str());
return 1;
@@ -915,9 +914,9 @@ string mhmakefileparser::GetFullCommand(string Command) }
if (!bBuild)
{
- set< refptr<fileinfo> > Autodeps;
+ deps_t Autodeps;
GetAutoDeps(pPyFile, Autodeps);
- set< refptr<fileinfo> >::iterator It=Autodeps.begin();
+ deps_t::iterator It=Autodeps.begin();
while (It!=Autodeps.end())
{
if (pExeFile->GetDate().IsOlder((*It)->GetDate()))
@@ -1063,9 +1062,11 @@ bool OsExeCommand(const string &Command,const string &Params,bool IgnoreError,st if (!CreateProcess(NULL,pFullCommand,NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,curdir::GetCurDir()->GetFullFileName().c_str(),&StartupInfo,&ProcessInfo))
{
delete[] pFullCommand;
- cerr << "Error starting command: "<<FullCommandLine<<" : "<<GetLastError()<<endl;
- if (!IgnoreError)
- throw(1);
+ string ErrorMessage=string("Error starting command: ") + FullCommandLine + " : " + stringify(GetLastError());
+ if (IgnoreError)
+ cerr << ErrorMessage << endl;
+ else
+ throw ErrorMessage;
}
delete[] pFullCommand;
if (!CloseHandle(hChildStdinRd)) return false;
@@ -1091,9 +1092,11 @@ bool OsExeCommand(const string &Command,const string &Params,bool IgnoreError,st if (!CreateProcess(NULL,pFullCommand,NULL,NULL,TRUE,0,NULL,curdir::GetCurDir()->GetFullFileName().c_str(),&StartupInfo,&ProcessInfo))
{
delete[] pFullCommand;
- cerr << "Error starting command: "<<Command<<" : "<<GetLastError()<<endl;
- if (!IgnoreError)
- throw(1);
+ string ErrorMessage=string("Error starting command: ") + Command + " : " + stringify(GetLastError());
+ if (IgnoreError)
+ cerr << ErrorMessage << endl;
+ else
+ throw ErrorMessage;
}
delete[] pFullCommand;
CloseHandle(ProcessInfo.hThread);
@@ -1447,6 +1450,11 @@ mh_time_t mhmakefileparser::BuildTarget(const refptr<fileinfo> &Target,bool bChe static int Indent;
#endif
+ if (g_StopCompiling)
+ {
+ throw string("Compilation Interrupted by user.");
+ }
+
if (Target->IsBuild())
{
#ifdef _DEBUG
@@ -1646,11 +1654,11 @@ mh_time_t mhmakefileparser::BuildTarget(const refptr<fileinfo> &Target,bool bChe #endif
if (!pMakefile->ExecuteCommand(Command))
{
- cerr << "Error running command: "<<Command<<endl;
- cerr << "Command defined in makefile: "<<GetMakeDir()->GetQuotedFullFileName()<<endl;
+ string ErrorMessage = string("Error running command: ")+ Command +"\n";
+ ErrorMessage += "Command defined in makefile: " + GetMakeDir()->GetQuotedFullFileName();
Target->SetCommandsMd5_32(0); /* Clear the md5 to make sure that the target is rebuild the next time mhmake is ran */
m_AutoDepsDirty=true; /* We need to update the autodeps file if the md5 has been changed */
- throw(1);
+ throw ErrorMessage;
}
}
CommandIt++;
|