crafter-build V2
This commit is contained in:
parent
2a8405cf21
commit
54b8921396
1 changed files with 2 additions and 12 deletions
14
project.cpp
14
project.cpp
|
|
@ -4,23 +4,13 @@ namespace fs = std::filesystem;
|
||||||
using namespace Crafter;
|
using namespace Crafter;
|
||||||
|
|
||||||
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
|
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
|
||||||
bool debug = false;
|
|
||||||
bool timing = false;
|
|
||||||
std::string target = "x86_64-pc-linux-gnu";
|
|
||||||
for (std::string_view arg : args) {
|
|
||||||
if (arg == "--debug") debug = true;
|
|
||||||
else if (arg == "--timing") timing = true;
|
|
||||||
else if (arg.starts_with("--target=")) target = std::string(arg.substr(std::string_view("--target=").size()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Configuration cfg;
|
Configuration cfg;
|
||||||
cfg.path = "./";
|
cfg.path = "./";
|
||||||
cfg.name = "Crafter.Event";
|
cfg.name = "Crafter.Event";
|
||||||
cfg.outputName = "Crafter.Event";
|
cfg.outputName = "Crafter.Event";
|
||||||
cfg.target = target;
|
|
||||||
cfg.type = ConfigurationType::LibraryStatic;
|
cfg.type = ConfigurationType::LibraryStatic;
|
||||||
cfg.debug = debug;
|
auto opts = ApplyStandardArgs(cfg, args);
|
||||||
if (timing) cfg.defines.push_back({"CRAFTER_TIMING", ""});
|
if (opts.Has("--timing")) cfg.defines.push_back({"CRAFTER_TIMING", ""});
|
||||||
|
|
||||||
std::array<fs::path, 1> ifaces = { "interfaces/Crafter.Event" };
|
std::array<fs::path, 1> ifaces = { "interfaces/Crafter.Event" };
|
||||||
std::array<fs::path, 0> impls = {};
|
std::array<fs::path, 0> impls = {};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue