Skip to content

Yet another Clang's JSON compilation database generator for make-based build systems.

Notifications You must be signed in to change notification settings

adonis0147/wrapper_c

Repository files navigation

wrapper_c

ci_meson

WRAPPER_C is a compiler wrapper. It is another Clang's JSON compilation database generator for make-based build systems.

Unlike Bear which uses LD_PRELOAD, wrapper_c exploits the implicit variables CC and CXX to intercept the compilation commands from make and forwards the commands to the compiler.

Usage

Usage: ./wrapper_c [OPTION]... -- compiler

OPTION
        -h, --help      Help
        -v, --version   Version
        -n, --no_exec   Don't execute the command for the compiler.
        -d, --debug     Activate the logging.

Installation

Prerequisites

  1. C++ compiler which supports C++ 17
  2. Meson
  3. Ninja
git clone https://github.com/adonis0147/wrapper_c
cd wrapper_c
git submodule update --init --progress

Build from Source

meson build --buildtype=release -Dprefix=/path/to/wrapper_c
ninja install -C build

User Manual

CC="/path/to/wrapper_c -- gcc" CXX="/path/to/wrapper_c -- g++" ./configure
/path/to/wrapper_make

For the sake of convenience, adding the path to the environment variable PATH is recommended.

Alias

CC="/path/to/wrapper_gcc" CXX="/path/to/wrapper_g++" ./configure
/path/to/wrapper_make

Parellel

/path/to/wrapper_make -j <num_jobs>