command-line option support + switch compiler profile on command line

This commit is contained in:
Hunter 2024-09-29 16:35:45 -04:00
parent dfcf57aae1
commit 816dcbe118
12 changed files with 359 additions and 155 deletions

View file

@ -272,4 +272,8 @@ std::string grbc_platform_file(PlatformType platform_type,
bool grbc_is_ext_loaded(const std::string &extension_name);
void grbc_task(const TaskConfig &config);
void grbc_task(const TaskConfig &config);
bool grbc_has_option(const std::string &option_name);
std::string grbc_get_option(const std::string &option_name);

View file

@ -2,31 +2,34 @@
#include "grbc/ext.h"
#include "grbc/generator.h"
#include "grbc/spec.h"
#include <map>
#include <sol/sol.hpp>
#include <string>
#include <unordered_map>
#include <vector>
struct GState {
Platform current_platform{};
sol::state lua;
Platform current_platform{};
sol::state lua;
std::vector<GeneratorTask> tasks;
std::vector<GeneratorTarget> targets;
std::vector<Generator> generators;
std::vector<GeneratorTask> tasks;
std::vector<GeneratorTarget> targets;
std::vector<Generator> generators;
std::unordered_map<std::string, Package> packages;
std::map<std::string, std::string> options;
std::vector<Extension> extensions;
std::unordered_map<std::string, Package> packages;
std::string global_compiler_flags = "";
std::string global_linker_flags = " ";
std::vector<Extension> extensions;
std::string ninja_output;
std::string global_compiler_flags = "";
std::string global_linker_flags = " ";
static GState& get() {
static GState state{};
std::string ninja_output;
return state;
}
static GState &get() {
static GState state{};
return state;
}
};