LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
main.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Yeong-won Seo
3 *
4 * This file is part of LILAC.
5 *
6 * LILAC is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3, or (at your option) any later
9 * version.
10 *
11 * LILAC is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
21#include "generatesubcommand.h"
22#include "pch.h"
23#include "subcommand.h"
24#include "shared/version.h"
25
26static lilac::GenerateSubCommand GenerateSubCommand{};
27static lilac::CompileSymbolSubCommand CompileSymbolSubCommand{};
28
29int main(int argc, const char* argv[])
30{
31 llvm::cl::SetVersionPrinter([](llvm::raw_ostream& ost)
32 {
33 ost << "lilac (LIALC) " << LILAC_DATE << '\n' << LILAC_SHORT_LICENSE;
34 });
35 llvm::cl::HideUnrelatedOptions(lilac::SubCommand::GetCategory());
36 llvm::cl::ParseCommandLineOptions(argc, argv);
37
38 if (GenerateSubCommand)
39 return GenerateSubCommand.Run();
40 if (CompileSymbolSubCommand)
41 return CompileSymbolSubCommand.Run();
42
43 llvm::errs() << "Subcommand is required\n";
44 return -1;
45}
A sub-command that compiles assemblies into symbols.
int Run() override
Runs a subcommand.
A sub-command that generates bindings from symbols.
int Run() override
Runs a subcommand.
static llvm::cl::OptionCategory & GetCategory()
Gets default category of all sub-commands registered by LILAC.
int main(int argc, const char *argv[])
Definition main.cxx:29
#define LILAC_DATE
Definition version.h:51
#define LILAC_SHORT_LICENSE
Definition version.h:53