- Notifications
You must be signed in to change notification settings - Fork4
tee3/commands_to_compilation_database
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a program to generate a compilation database from the outputof a build tool. It has built in support for the output of theclang
toolset for Boost.Build, simplemake
, and provides amechanism to specify the regular expression to match a compilercommand.
There is a Python version and a C++ version.
There is a program to generate a compilation database from a list offiles on the standard input. Compiler flags can be given on thecomamnd line.
This is a work in progress and has not been widely tested.
It has been tested with Boost.Build on Linux and OS X (not tested onWindows yet).
The following is a minimum that needs to be tested.
- Test Python version on Windows.
- Test C++ version on Windows.
- Test
--compile-command-regex
option. - Test adding additional compiler strings.
- Test adding additional source file extensions.
- Test Objective-C and Objective-C++ support.
- Expand automated testing.
- Test
--incremental
option operation.
Many build tools provide an option to print the commands taken andthis program will take this as input and create a compilation databasefrom it. This is useful with build systems that do not have nativesupport for generating compilation databases.
To show the options, run the following commands.
commands_to_compilation_database_py --help
commands_to_compilation_database_cpp --help
The simplest usage is to pipe the output from the compilation to theprogram. The following command shows the usage with Boost.Build byforcing the tool to generate all targets and dry-running the build(which prints the commands).
b2 -a -n | commands_to_compilation_database_py --build-tool=Boost.Build
If the build tool provides a mechanism to output the compilationcommands while running, the compilation database can be updatedincrementally on each build as shown below for Boost.Build.
b2 -d+2 | tee | commands_to_compilation_database_py --build-tool=Boost.Build --incremental
To show the options, run the following commands.
files_to_compilation_database_py --help
files_to_compilation_database_cpp --help
The simplest usage is to pipe a list of filenames to the program. Thefollowing command shows the usage with Git to generate the list of Cand C++ source and header filenames.
git ls-files *.[ch] *.[ch]pp | \ files_to_compilation_database_py \ --cflags="-std=c89" \ --cxxflags="-std=c++11" \ --include=include/dir1 \ --include=include/dir2
- Python 3.7
Standard C++11 Compiler
auto
std::begin
,std::end
- etc.
Standard C++11 Standard Library
<regex>
Boost C++ Libraries 1.55.0
- Boost.Program Options
- Boost.Filesytem
- Boost.Algorithm (String)
Boost.Build from Boost C++ Libraries 1.55.0
Run the following command to build and test the system.
b2
Run the following command to install the system to the/usr/local
prefix.
b2 --prefix=/usr/local install
About
A program to generate a compilation database from compilation commands.
Resources
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.