github / github/codeql-cli-binaries

Can codeql binary use compile_database.json for cpp projects?

未關閉
#9 1 則留言 8 個 reaction 已指派 1 人 已被 @p0 認領 在 GitHub 檢視
CLI enhancement
主要語言
沒有語言資料
星號
1k
分支
184
PR 合併指標
30 天內沒有已合併 PR

描述

Do I understand correctly, that to create new database with codeql for cpp project, it is enough to provide a list of files and build flags?

If so, can you please add an option to create a database from `compile_commands.json` file (https://clang.llvm.org/docs/JSONCompilationDatabase.html)?

If project uses **cmake**, to generate it, it is enough to define a single var:
```
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
```

If project uses **autotools**, like bitcoin or linux, it is enough to execute [`compiledb`](https://github.com/nickdiego/compiledb)
```
./autotools.sh
./configure
compiledb -n make
```

I am sure, there are ways to generate one for other build systems.

This feature can save a lot of time during database creation for cpp projects, because generation of this file is fast, as opposed to providing `-c` flag to `codeql` binary to actually build the project.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。