From c3da06349352e389c68a54702a22f6926adf392c Mon Sep 17 00:00:00 2001 From: Interfiber Date: Mon, 14 Oct 2024 08:35:25 -0400 Subject: [PATCH] grbc build config --- .gitignore | 3 ++- HConfig | 7 +++++++ build.ninja | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ init.lua | 26 +++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 HConfig create mode 100644 build.ninja create mode 100644 init.lua diff --git a/.gitignore b/.gitignore index c5e82d7..a5e8447 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -bin \ No newline at end of file +bin +build/ diff --git a/HConfig b/HConfig new file mode 100644 index 0000000..d83aa85 --- /dev/null +++ b/HConfig @@ -0,0 +1,7 @@ +grbc_want_version("1.0") + +grbc_ext("GRBC_EXT_profiles") + +require("init") + +grbc_build("ninja") diff --git a/build.ninja b/build.ninja new file mode 100644 index 0000000..c544c6a --- /dev/null +++ b/build.ninja @@ -0,0 +1,55 @@ +### GENERATED BY THE GRBC BUILT-IN NINJA GENERATOR ### +### GENERATED ON: 1728873691 ### + +## 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/dlopen.c ## + +build $builddir/src/dlopen.o: cc src/dlopen.c + p_cflags = -Isrc -g -O1 + +## Link: libhotwire.a ## + +build $builddir/libhotwire.a: archive $builddir/src/dlopen.o + +build all: phony $builddir/libhotwire.a + +default all diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..192e976 --- /dev/null +++ b/init.lua @@ -0,0 +1,26 @@ +local hotwire_lib = grbc_library(LibraryConfig.new({ + name = "libhotwire", + language_type = LanguageType.C, + + files = { + grbc_file("src/dlopen.c") + }, + + lib_type = LibraryType.Static, + requirements = {}, + compile_flags = {}, + linker_flags = {}, + include_dirs = { + grbc_file("src") + }, + + package_config = PackageConfig.new({ + name = "libhotwire", + libraries = {}, + include_dirs = { + grbc_file("src") + }, + compile_flags = {}, + linker_flags = {} + }) +}))