ext_easy impl + demo + fixes
This commit is contained in:
parent
1036d97ec6
commit
ec26aa89e7
33 changed files with 2796 additions and 40 deletions
75
example/build.ninja
Normal file
75
example/build.ninja
Normal file
|
@ -0,0 +1,75 @@
|
|||
### GENERATED BY THE GRBC BUILT-IN NINJA GENERATOR ###
|
||||
### GENERATED ON: 1727643213 ###
|
||||
|
||||
## 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: test.c ##
|
||||
|
||||
build $builddir/test.o: cxx test.c
|
||||
p_cflags = -fPIC -Iinclude
|
||||
|
||||
## Link: libtest.so ##
|
||||
|
||||
build $builddir/libtest.so: link_cxx $builddir/test.o
|
||||
p_linker_flags = -shared -O3 -DNDEBUG -Lbuild -Wl,-rpath,build:.
|
||||
p_cflags =
|
||||
|
||||
## Compile: main.c ##
|
||||
|
||||
build $builddir/main.o: cxx main.c
|
||||
p_cflags = -Iinclude
|
||||
|
||||
## Link: hello_world ##
|
||||
|
||||
build $builddir/hello_world: link_cxx $builddir/main.o | $builddir/libtest.so
|
||||
p_linker_flags = build/libtest.so -O3 -DNDEBUG -Lbuild -Wl,-rpath,build:.
|
||||
p_cflags =
|
||||
|
||||
## clean ##
|
||||
rule clean_task
|
||||
command = ninja -t clean
|
||||
description = Running task: Clean (clean)
|
||||
|
||||
build clean: clean_task
|
||||
|
||||
build all: phony $builddir/libtest.so $builddir/hello_world
|
||||
|
||||
default all
|
Loading…
Add table
Add a link
Reference in a new issue