Coder Social home page Coder Social logo

marzojr / compdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sarcasm/compdb

0.0 0.0 0.0 171 KB

The compilation database Swiss army knife

License: MIT License

Shell 8.46% C++ 2.01% Python 85.02% C 0.14% Makefile 4.00% Dockerfile 0.37%

compdb's Introduction

compdb: the compilation database Swiss army knife

local

Introduction

compdb is a command line tool to manipulates compilation databases. A compilation database is a database for compile options, it has records of which compile options are used to build the files in a project. An example of compilation database is the JSON Compilation Database

compdb aims to make it easier for you to run tools on your codebase by spoon-feeding you the right compile options.

compdb is not so much about generating the initial compilation database, this, is left to other tools, such as cmake and ninja. It is only a glue between the initial compilation database and your tool(s).

Motivation

With the proliferation of Clang-based tools, it has become apparent that the compile options are no longer useful uniquely to the compiler.

Standalone tools such as clang-tidy or text editors with libclang integration have to deal with compile options.

Examples of such tools, dealing with compilation databases are: irony-mode, rtags and ycmd.

Based on this evidence, compdb came to life. A tool that has knowledge of the compile options and can share it both to inform the text editor and to run clang based tool from the shell.

Getting started

Installation

Install with pip:

pip install compdb

From Github, as user:

pip install --user git+https://github.com/Sarcasm/compdb.git#egg=compdb

Generate a compilation database with header files

Assuming a build directory build/, containing a compile_commands.json, a new compilation database, containing the header files, can be generated with:

compdb -p build/ list > compile_commands.json

Running the tests

To run the tests, type:

python -m tests

Or:

tox --skip-missing-interpreters

For regression tests on a few open source projects:

cd tests/regression/headerdb
make [all|help]

Contribute

Contributions are always welcome!

Try to be consistent with the actual code, it will ease the review.

License

This project is licensed under the MIT License. See LICENSE.txt for details.

Acknowledgments

  • repo: for its ubiquitous command line interface, which served as an inspiration
  • scan-build: for the clear Python package design
  • git: for the git-config API
  • julio.meroh.net: for the interesting article serie on CLI design

compdb's People

Contributors

sarcasm avatar marzojr avatar nagua avatar snizovtsev avatar

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.