#build #build-tool #c #toml #c

build builder_cpp

A simple build tool for building C and C++ applications

19 unstable releases (3 breaking)

0.4.13 May 4, 2023
0.4.12 May 4, 2023
0.4.9 Apr 13, 2023
0.4.5 Mar 29, 2023
0.1.0 Mar 9, 2023

#112 in Build Utils

Download history 137/week @ 2023-03-09 58/week @ 2023-03-16 60/week @ 2023-03-23 55/week @ 2023-03-30 37/week @ 2023-04-06 53/week @ 2023-04-13 20/week @ 2023-04-20 43/week @ 2023-04-27 107/week @ 2023-05-04 5/week @ 2023-05-11 8/week @ 2023-05-18 25/week @ 2023-05-25

184 downloads per month

MIT license

74KB
1.5K SLoC

BUILDER_CPP

A simple build tool for building C and C++ applications

The tool is still in development. Do not use for production code.

Installation

The tool requires cargo for installation

cargo install builder_cpp

For subcommands run with -h flag

Features

  • Create new project
  • Multithreaded
  • Can generate compile_commands.json
  • Can generate .vscode/c_cpp_properties.json
  • Auto add project libraries to other targets
  • Get libraries as packages from github

Usage

Write a config_win32.toml for windows and config_linux.toml for linux

To create a new project

builder_cpp --init <project-name> [--c|--cpp]

For help

builder_cpp --help

Sample file with a library and an executable

[build]
compiler = "g++"

[[targets]]
name = "libengine"
src = "./Nomu_Engine/Engine/src/"
include_dir = "./Nomu_Engine/Engine/src/include"
type = "dll"
cflags = "-g -Wall -Wunused `pkg-config --cflags freetype2` -std=c++17"
libs = "-lm -lglew32 -lglfw3 -lopengl32 -static-libstdc++ `pkg-config --libs freetype2`"

[[targets]]
name = "main"
src = "./Nomu_Engine/Game/src/"
include_dir = "./Nomu_Engine/Game/src"
type = "exe"
cflags = "-g -Wall"
libs = "-static-libstdc++"
deps = ["libengine"]

Sample file with an added package and an executable

[build]
compiler = "g++"
packages = ["Dr-42/Nomu_Engine, master"]

[[targets]]
name = "main"
src = "./src"
include_dir = "./src"
type = "exe"
cflags = "-g -Wall "
libs = ""
deps = ["libengine"]

Optional keys in toml are packages in build and deps in targets

To see a real project being built with the tool Nomu_Engine

Dependencies

~3–8.5MB
~147K SLoC