-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source language set to c++ when g++ is called.
ld-logger logs the full path of the compiler (insted of only basename) so that compiler settings auto-detection can be done by the analyze even if the compiler is not in the PATH when analyze is called. Include path auto-detection is switched off from ld-logger and always done by the analyze sub-command. --add-compiler-defaults flag gets deprecated as auto-detection is always performed (even if it is not set). Fix logger test Since `--add-compiler-defaults` is forced, the `--target=...` flag also becomes the part of the build command when analyzing. If clang is used as the compiler for the project, compilation target is autodetected also, this way the handling becoming identical to gcc. build-logger got documented. HOWTO is extended with incremental analsysis description. We removed cross-compilation description from the HOWTO as it is done automatically. It is not recommended anymore to set in in the saargs and tidy-args files.
- Loading branch information
Showing
10 changed files
with
199 additions
and
93 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Build Logger | ||
|
||
This tool can capture the build process and generate a | ||
[JSON Compilation Database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) | ||
|
||
## Compilation | ||
|
||
To build the project execute | ||
~~~~~~~ | ||
cd vendor/build-logger | ||
make -f Makefile.manual | ||
~~~~~~~ | ||
|
||
## Usage | ||
|
||
Set the following environment variables: | ||
~~~~~~~ | ||
export LD_PRELOAD=ldlogger.so | ||
export LD_LIBRARY_PATH=`pwd`/build/lib:$LD_LIBRARY_PATH | ||
export CC_LOGGER_GCC_LIKE="gcc:g++:clang" | ||
#The output compilation JSON file | ||
export CC_LOGGER_FILE=`pwd`/compilation.json | ||
~~~~~~~ | ||
|
||
then when you call `gcc` from a sub-shell (e.g. as a part of a Make build process), | ||
`compilation.json` will be created. | ||
For example: | ||
`bash -c "gcc -c something.c"` | ||
will create | ||
~~~~~~~ | ||
compilation.json: | ||
[ | ||
{ | ||
"directory": "/home/john_doe/", | ||
"command": "/usr/bin/gcc-4.8 -c /home/john_doe/something.c", | ||
"file": "/home/john_doe/something.c" | ||
} | ||
] | ||
~~~~~~~ | ||
|
||
|
||
|
||
## Environment Variables | ||
|
||
### `CC_LOGGER_GCC_LIKE` | ||
You can change the compilers that should be logged. | ||
Set `CC_LOGGER_GCC_LIKE` environment variable to a colon separated list. | ||
|
||
For example (default): | ||
|
||
```export CC_LOGGER_GCC_LIKE="gcc:g++:clang"``` | ||
|
||
The logger will match any compilers with `gcc`,`g++` or `clang` in their filenames. | ||
|
||
|
||
### `CC_LOGGER_FILE` | ||
Output file to generate compilation database into. | ||
This can be a relative or absolute path. | ||
|
||
### `CC_LOGGER_JAVAC_LIKE` | ||
You can specify the `javac` like | ||
compilers that should be logged as a colon separated string list. | ||
|
||
### `CC_LOGGER_DEF_DIRS` | ||
If the environment variable is defined, | ||
the logger will extend the compiler argument list in the compilation | ||
database with the pre-configured include paths of the logged compiler. | ||
|
||
|
Oops, something went wrong.