pkg-config work

This commit is contained in:
Hunter 2024-09-29 10:08:34 -04:00
parent 3ddb2943bc
commit fc1964f766
10 changed files with 152 additions and 501 deletions

View file

@ -1 +1,5 @@
#include "grbc/ext.h"
#include "grbc/ext.h"
void grbc_register_ext(const std::string &extension_id, const Extension &ext) {}
void grbc_ext(const std::string &extension_id) {}

17
src/ext_pkg_config.cc Normal file
View file

@ -0,0 +1,17 @@
#include "grbc/ext_pkg_config.h"
#include "grbc/ext.h"
#include "grbc/helpers.h"
#include "sol/state.hpp"
void grbc_pkg_config_init(sol::state &state) {
log_msg("pkg_config extension loaded!");
}
Extension grbc_pkg_config() {
Extension ext{};
ext.name = GRBC_EXT_pkg_config_NAME;
ext.hook_init = grbc_pkg_config_init;
return ext;
}

View file

@ -1,3 +1,4 @@
#include "grbc/ext_pkg_config.h"
#include "grbc/state.h"
#define SOL_ALL_SAFETIES_ON 1
@ -99,12 +100,17 @@ int main() {
lua.set("grbc_get_lib_extension", grbc_get_lib_extension);
lua.set("grbc_bake_package_config", grbc_bake_package_config);
lua.set("grbc_pkg", grbc_pkg);
lua.set("grbc_ext", grbc_ext);
lua.set("grbc_register_ext", grbc_register_ext);
// Load generators
GState::get().generators.push_back(
{.name = "ninja", .func = ninja_generator});
// Load default extensions
grbc_register_ext(GRBC_EXT_pkg_config_NAME, grbc_pkg_config());
log_msg("loading HConfig...");
lua.script_file("HConfig");