# clang-flags

> A library for determining the clang compilation flags needed for a source file

Latest version **0.2.2** (published 2015-04-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install clang-flags
pnpm add clang-flags
yarn add clang-flags
bun add clang-flags
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2015-04-06 |
| First published | 2014-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Kevin Smith |
| Maintainers | kev |

## Links

- npm: https://www.npmjs.com/package/clang-flags
- Repository: https://github.com/Kev/clang-flags
- Issues: https://github.com/Kev/clang-flags/issues
- npm.io page: https://npm.io/package/clang-flags

## Recent versions

- 0.2.2 (latest) — 2015-04-06
- 0.2.1 — 2015-02-24
- 0.2.0 — 2015-02-24
- 0.1.2 — 2014-08-13
- 0.1.1 — 2014-08-13
- 0.1.0 — 2014-06-15
- 0.0.0 — 2014-06-15

## README

# clang-flags package

Helper library for Atom to determine the clang compiler flags needed for a file.
This is useful if you want to write a completion, lint, or other clang-using
package.

## Supported Mechanisms

### .clang-complete

The .clang-complete is used by vim's clang-complete script. It contains all the
flags needed by a project, one flag per line. It's fairly coarse, not allowing
different flags per file, but is still easy to generate, and sufficient for
most projects.

### CompDB

CompDB is a JSON format for specifying the per-file compilation flags (http://clang.llvm.org/docs/JSONCompilationDatabase.html). Clang-flags will look for such a definition recursively up the tree in files called compile-commands.json, treating the location of such a file as the root of the project for relative paths. How to generate such a file depends on the build system in use - ninja and cmake can both generate them natively, and a tool called 'bear' can generate them for other build systems. For example, with ninja a command such as `ninja -t compdb cc cxx > compile_commands.json` might get you what you need.

---
_Source: https://npm.io/package/clang-flags · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
