builder_cpp/
lib.rs

1//! A library for building and packaging C and C++ projects.
2//!
3//! This library automatically configures various targets in your project
4//! and gives an easy interface to grab packages from github.
5//!
6//! The library uses config_linux.toml or config_win32.toml file to configure the project.
7//!
8//! # Installation
9//! To install this library, you need to have rust installed on your system.
10//! ```no_run
11//! cargo install builder_cpp
12//! ```
13//!
14//! # Examples
15//! To get the various flags that can be passed to builder_cpp
16//! ```no_run
17//! builder_cpp -h
18//! ```
19//! or
20//! ```no_run
21//! builder_cpp --help
22//! ```
23//!
24//! # Sample toml files
25//! Optional keys in toml are packages in build and deps in targets
26//! Project contains an executable and a library from a github repo
27//! ```toml
28//! # config_linux.toml
29//![build]
30//!compiler = "g++"
31//!packages = ["Dr-42/Nomu_Engine, master"]
32//!
33//![[targets]]
34//!name = "main"
35//!src = "./src"
36//!include_dir = "./src"
37//!type = "exe"
38//!cflags = "-g -Wall "
39//!libs = ""
40//!deps = ["libengine"]
41//!```
42//! Projects contains a library and an executable
43//!```toml
44//! # config_win32.toml
45//![build]
46//!let compiler = "g++"
47//!build_dir = "./bin"
48//!obj_dir = "./obj_win"
49//!
50//![[targets]]
51//!name = "libengine"
52//!src = "./Engine/src/"
53//!include_dir = "./Engine/src/include"
54//!type = "dll"
55//!cflags = "-g -Wall -Wunused `pkg-config --cflags freetype2` -std=c++17"
56//!libs = "-lm -lglew32 -lglfw3 -lopengl32 -static-libstdc++ `pkg-config --libs freetype2`"
57//!
58//![[targets]]
59//!name = "main"
60//!src = "./Game/src/"
61//!include_dir = "./Game/src"
62//!type = "exe"
63//!cflags = "-g -Wall"
64//!libs = "-static-libstdc++"
65//!deps = ["libengine"]
66//!```
67
68/// Contains code that handles various binary flags
69pub mod bin_flags;
70/// Contains code to build projects
71pub mod builder;
72/// Contains logger and config parser
73pub mod utils;
74/// Contains hashing related functions
75pub mod hasher;
76/// Handles global config
77pub mod global_config;