https://github.com/chqilin/beninja
a small build tools for C/C++.
https://github.com/chqilin/beninja
build-tool cmake cplusplus cpp makefile nodejs
Last synced: about 2 months ago
JSON representation
a small build tools for C/C++.
- Host: GitHub
- URL: https://github.com/chqilin/beninja
- Owner: chqilin
- Created: 2021-04-11T07:29:58.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-07T13:52:24.000Z (almost 5 years ago)
- Last Synced: 2025-10-24T22:41:43.846Z (8 months ago)
- Topics: build-tool, cmake, cplusplus, cpp, makefile, nodejs
- Language: JavaScript
- Homepage:
- Size: 626 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# beninja
a small C/C++ meta-build-tool for ninja.
## Install
* install nodejs from https://nodejs.org
* execute command in system Terminal
```shell
npm install -g beninja
```
* On Windows system, you need do the steps below:
1. Install clang: https://github.com/llvm/llvm-project/releases/tag/llvmorg-12.0.1 .
2. Open PowerShell and execute command below:
```shell
set-ExecutionPolicy -Scope CurrentUser RemoteSigned
```
## build.json
Beninja need a build config file (build.json default). So we must
create this json file manually. the file content just like:
```
{
"project": "eokas",
"version": "0.0.1",
"buildDir": "_build",
"installDir": "_install",
"vars": {
"depsDir": "./deps/",
"cflags": "-O3 -std=c++17"
},
"targets": [{
"name": "eokas",
"type": "executable",
"cflags": ["${cflags}"],
"lflags": [],
"defines": [
"_WINDOW_WIDTH=800",
"_WINDOW_HEIGHT=600",
"_WINDOW_TITLE=\"my-demo\""
],
"includes": [
"-I${depsDir}"
],
"libraries": [
"-L${depsDir}",
"-larchaism"
],
"runtimes": [
"@executable_path"
],
"sources": [
"./src/*.cpp"
],
"copies": [
"./src/*.h"
]
}]
}
```
## Usage
* use beninja with one command.
```
beninja start
```
* use beninja step by step.
```
// list all vars
beninja vars
// build.json -> build.ninja
beninja build
// build targets by build.ninja
beninja make
// install targets and headers.
beninja install
// clean build files
beninja clean
```
## LICENSE
ISC