profile support

This commit is contained in:
Hunter 2024-09-29 14:51:11 -04:00
parent f32bf63c98
commit 2bb469b26f
13 changed files with 142 additions and 91 deletions

View file

@ -3,11 +3,13 @@
#include <string>
#define GRBC_EXT_pkg_config_NAME "GRBC_EXT_pkg_config"
#define GRBC_EXT_profiles_NAME "GRBC_EXT_profiles"
typedef void (*EXT_HookInit)(sol::state &lua);
struct Extension {
std::string name;
bool loaded = false;
EXT_HookInit hook_init = nullptr;
};

View file

@ -0,0 +1,14 @@
#pragma once
#include "grbc/ext.h"
struct Profile {
std::string name;
std::vector<std::string> compiler_flags;
std::vector<std::string> linker_flags;
};
/**
* Get the grbc profiles extension
*/
Extension grbc_profiles();

View file

@ -251,4 +251,6 @@ void grbc_register_ext(const Extension &ext);
bool grbc_has_ext(const std::string &extension_id);
std::string grbc_platform_file(PlatformType platform_type,
const std::string &file_name);
const std::string &file_name);
bool grbc_is_ext_loaded(const std::string &extension_name);

View file

@ -18,8 +18,8 @@ struct GState {
std::vector<Extension> extensions;
std::string global_compiler_flags = " ";
std::string global_linker_flags = " ";
std::string global_compiler_flags = "";
std::string global_linker_flags = "";
std::string ninja_output;