work on dynamic extensions
This commit is contained in:
parent
8b1c5b9073
commit
b3a326720b
22 changed files with 282 additions and 165 deletions
18
fusion_ext/HConfig
Normal file
18
fusion_ext/HConfig
Normal file
|
@ -0,0 +1,18 @@
|
|||
local grbc_extensions = grbc_library(LibraryConfig.new({
|
||||
name = "libfusion",
|
||||
language_type = LanguageType.Cpp,
|
||||
files = {
|
||||
grbc_file("src/ext_fusion.cc")
|
||||
},
|
||||
lib_type = LibraryType.Shared,
|
||||
|
||||
requirements = {},
|
||||
compile_flags = {},
|
||||
linker_flags = {},
|
||||
|
||||
include_dirs = {
|
||||
"../vendor/sol2/include"
|
||||
}
|
||||
}))
|
||||
|
||||
grbc_build("ninja")
|
2
fusion_ext/README.txt
Normal file
2
fusion_ext/README.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
FUSION GRBC EXTENSION
|
||||
|
57
fusion_ext/build.ninja
Normal file
57
fusion_ext/build.ninja
Normal file
|
@ -0,0 +1,57 @@
|
|||
### GENERATED BY THE GRBC BUILT-IN NINJA GENERATOR ###
|
||||
### GENERATED ON: 1727735253 ###
|
||||
|
||||
## Default variables ##
|
||||
|
||||
builddir = build
|
||||
|
||||
## build_rule_compile_cc ##
|
||||
|
||||
cc_path = /usr/lib64/ccache/gcc
|
||||
rule cc
|
||||
command = $cc_path -MMD -MT $out -MF $out.d $p_cflags -c $in -o $out
|
||||
description = Compiling C object $in
|
||||
depfile = $out.d
|
||||
deps = gcc
|
||||
|
||||
## build_rule_compile_cxx ##
|
||||
|
||||
cxx_path = /usr/lib64/ccache/g++
|
||||
rule cxx
|
||||
command = $cxx_path -MMD -MT $out -MF $out.d $p_cflags -c $in -o $out
|
||||
description = Compiling C++ object $in
|
||||
depfile = $out.d
|
||||
deps = gcc
|
||||
|
||||
## build_rule_link_cc ##
|
||||
|
||||
rule link_cc
|
||||
command = $cc_path $p_cflags -o $out $in $p_linker_flags
|
||||
description = Linking C target $out
|
||||
|
||||
## build_rule_link_cxx ##
|
||||
|
||||
rule link_cxx
|
||||
command = $cxx_path $p_cflags -o $out $in $p_linker_flags
|
||||
description = Linking C++ target $out
|
||||
|
||||
## build_rule_archive_library ##
|
||||
|
||||
rule archive
|
||||
command = rm -f $out; ar crs $out $in
|
||||
description = Creating static library $out
|
||||
|
||||
## Compile: src/ext_fusion.cc ##
|
||||
|
||||
build $builddir/src/ext_fusion.o: cxx src/ext_fusion.cc
|
||||
p_cflags = -fPIC -I../vendor/sol2/include
|
||||
|
||||
## Link: libfusion.so ##
|
||||
|
||||
build $builddir/libfusion.so: link_cxx $builddir/src/ext_fusion.o
|
||||
p_linker_flags = -shared -Lbuild -Wl,-rpath,build:.
|
||||
p_cflags =
|
||||
|
||||
build all: phony $builddir/libfusion.so
|
||||
|
||||
default all
|
10
fusion_ext/src/ext_fusion.cc
Normal file
10
fusion_ext/src/ext_fusion.cc
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include "grbc/spec.h"
|
||||
#include <sol/state.hpp>
|
||||
|
||||
const char* GRBC_Get_Name() {
|
||||
return "GRBC_EXT_Fusion";
|
||||
}
|
||||
|
||||
void GRBC_Hook_Init(sol::state &lua) {
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue