From 26b57fbea1a969ef6405365ff78391e9d3605621 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Tue, 11 Oct 2022 03:18:42 +0100 Subject: add cmakelists for CLion, tons and tons of reorganisation using new info from the Pro8 compiler --- command_line/CmdLine/Src/Clients/CLStaticMain.c | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 command_line/CmdLine/Src/Clients/CLStaticMain.c (limited to 'command_line/CmdLine/Src/Clients/CLStaticMain.c') diff --git a/command_line/CmdLine/Src/Clients/CLStaticMain.c b/command_line/CmdLine/Src/Clients/CLStaticMain.c new file mode 100644 index 0000000..cecab30 --- /dev/null +++ b/command_line/CmdLine/Src/Clients/CLStaticMain.c @@ -0,0 +1,45 @@ +#include "mwcc_decomp.h" + +int main(int argc, const char **argv) { + OSType cpu; + OSType os; + OSType lang; + OSType type; + OSType style; + int ret; + + if (CmdLine_Initialize(argc, argv, CMDLINE_BUILD_DATE, CMDLINE_BUILD_TIME)) + exit(1); + + if (!RegisterStaticParserResources() || !RegisterStaticTargetResources()) { + fprintf(stderr, "\nFATAL ERROR: Could not initialize resource strings\n"); + exit(1); + } + + if (!RegisterStaticParserPlugins() || !RegisterStaticTargetPlugins()) { + fprintf(stderr, "\nFATAL ERROR: Could not initialize built-in plugins\n"); + exit(1); + } + + if (!RegisterStaticParserToolInfo()) { + fprintf(stderr, "\nFATAL ERROR: Could not initialize options\n"); + exit(1); + } + + GetStaticTarget(&cpu, &os); + SetBuildTarget(cpu, os); + GetStaticPluginType(&lang, &type); + SetPluginType(lang, type); + GetStaticParserPluginType(&style); + SetParserType(style); + + ret = CmdLine_Driver(); + if (ret) { + if (ret == 2) + fprintf(stderr, "\nUser break, cancelled...\n"); + else + fprintf(stderr, "\nErrors caused tool to abort.\n"); + } + CmdLine_Terminate(ret); + return ret; +} -- cgit v1.2.3