Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wtrsltnk/cppbuild
An alternative build system where you write your build script in c++. Something like this could be in the c++ standard for simple programs.
https://github.com/wtrsltnk/cppbuild
build-system cpp
Last synced: about 12 hours ago
JSON representation
An alternative build system where you write your build script in c++. Something like this could be in the c++ standard for simple programs.
- Host: GitHub
- URL: https://github.com/wtrsltnk/cppbuild
- Owner: wtrsltnk
- License: mit
- Created: 2017-12-01T22:11:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T22:35:04.000Z (5 months ago)
- Last Synced: 2024-08-06T01:30:19.084Z (5 months ago)
- Topics: build-system, cpp
- Language: C++
- Size: 21.5 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CppBuild
An alternative build system where you write your build script in c++. Something like this could be in the c++ standard for simple programs.
You can use this file on Windows with the MinGW compiler. Put the files ``cppbuild.cmd`` and ``cppbuild.hpp`` in any folder from your PATH. Then create your build file with the name ``__build__.cpp`` and add the following code to this file:
```c++
#include
int main(int argc, char* argv[])
{
cppbuild::init(argc, argv);cppbuild::Target target("program");
target.files({
"program.cpp",
"library.cpp",
});target.includeDirs({
"include",
});return 0;
}```
This will create one target with the name ``program`` that will compile and link the files ``program.cpp`` and ``library.cpp`` into ``program.exe``. It will add the ``include`` directory as -I parameter to the compiler.
The following methods can be used on the cppbuild::Target class:
* ``files`` - Adds files to compile
* ``includeDirs`` - Adds directories with the ``-I`` parameter
* ``libraries`` - Adds libraries with the ``-l`` parameter
* ``libraryDirs`` - Adds directories with the ``-L`` parameter
* ``compilerFlags`` - Adds compiler flags
* ``linkerFlags`` - Adds linker flags
* ``installDir`` - Adds directory to install build artifacts into
* ``installFiles`` - Adds files to install## Cppbuild command and its parameters
To build your program open a commandline window at the folder containing the ``__build__.cpp`` and type ``cppbuild``.
The following parameters can be passed to the ``cppbuild`` command:
* ``clean`` - Cleans all build files
* ``build`` - Builds all project targets
* ``test`` - Runs all project tests
* ``run`` - Runs project target
* ``install`` - Installs the project