12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- //#define USE_OLD_BEEFBUILD
- #pragma warning(disable:4996)
- #include <iostream>
- #include "BeefySysLib/Common.h"
- #include "BeefySysLib/util/Array.h"
- #include "BeefySysLib/util/SizedArray.h"
- #include "BeefySysLib/util/Dictionary.h"
- #include "BeefySysLib/util/CabUtil.h"
- #include "BeefySysLib/util/BeefPerf.h"
- #include "BeefySysLib/util/Deque.h"
- #include "BeefySysLib/util/HashSet.h"
- #include "BeefySysLib/util/MultiHashSet.h"
- #include "CrashCatcher.h"
- //#include <mmsystem.h>
- //#include <shellapi.h>
- //#include <Objbase.h>
- #define BF_DBG_64
- #include "IDEHelper/StrHashMap.h"
- using namespace Beefy;
- #include "BootApp.h"
- BF_IMPORT void BF_CALLTYPE Debugger_ProgramDone();
- int main(int argc, char* argv[])
- {
- BfpSystem_SetCommandLine(argc, argv);
- BfpThread_SetName(NULL, "MainThread", NULL);
- BfpSystem_Init(BFP_VERSION, BfpSystemInitFlag_InstallCrashCatcher);
-
- gApp = new BootApp();
- bool success = true;
- for (int i = 1; i < argc; i++)
- {
- std::string arg = argv[i];
-
- if (arg[0] == '"')
- {
- arg.erase(0, 1);
- if ((arg.length() > 1) && (arg[arg.length() - 1] == '"'))
- arg.erase(arg.length() - 1);
- success &= gApp->HandleCmdLine(arg, "");
- continue;
- }
-
- int eqPos = (int)arg.find('=');
- if (eqPos == -1)
- {
- success &= gApp->HandleCmdLine(arg, "");
- continue;
- }
- std::string cmd = arg.substr(0, eqPos);
- std::string param = arg.substr(eqPos + 1);
- if ((param.length() > 1) && (param[0] == '"'))
- {
- param.erase(0, 1);
- if ((param.length() > 1) && (param[param.length() - 1] == '"'))
- param.erase(param.length() - 1);
- }
- success &= gApp->HandleCmdLine(cmd, param);
- }
-
- if (!gApp->mShowedHelp)
- {
- if (success)
- success = gApp->Init();
- if (success)
- success = gApp->Compile();
- if (success)
- gApp->OutputLine("SUCCESS", OutputPri_Critical);
- else
- gApp->OutputLine("FAILED", OutputPri_Critical);
- }
- delete gApp;
- Debugger_ProgramDone();
- BfpSystem_Shutdown();
- BP_SHUTDOWN();
- return success ? 0 : 1;
- }
|