Giter VIP home page Giter VIP logo

cppbuild's Introduction

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:

#include <cppbuild.hpp>

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.