32 lines
1.2 KiB
C++
32 lines
1.2 KiB
C++
#include "MetaEditor/EditorApplication.h"
|
|
|
|
#include <cstdlib>
|
|
#include <iostream>
|
|
#include <filesystem>
|
|
|
|
int main(int argc, char** argv) {
|
|
std::cerr << "[MetaCore][Trace] MetaEditor main: begin\n";
|
|
std::filesystem::path project_root = "D:/MetaCore/SandboxProject";
|
|
if (argc > 1) {
|
|
project_root = argv[1];
|
|
}
|
|
|
|
std::cerr << "[MetaCore][Trace] MetaEditor main: before app construction\n";
|
|
metacore::editor::EditorApplication app;
|
|
std::cerr << "[MetaCore][Trace] MetaEditor main: before initialize\n";
|
|
if (!app.initialize(project_root)) {
|
|
std::cerr << "[MetaCore][Trace] MetaEditor main: initialize failed\n";
|
|
return 1;
|
|
}
|
|
std::cerr << "[MetaCore][Trace] MetaEditor main: before run\n";
|
|
const int code = app.run();
|
|
std::cerr << "[MetaCore][Trace] MetaEditor main: after run\n";
|
|
const char* skip_shutdown = std::getenv("METACORE_SKIP_APP_SHUTDOWN");
|
|
if (!(skip_shutdown != nullptr && std::string(skip_shutdown) == "1")) {
|
|
std::cerr << "[MetaCore][Trace] MetaEditor main: before shutdown\n";
|
|
app.shutdown();
|
|
std::cerr << "[MetaCore][Trace] MetaEditor main: after shutdown\n";
|
|
}
|
|
return code;
|
|
}
|