esrlabs / bake

C++ build tool
http://esrlabs.github.io/bake
Other
26 stars 11 forks source link

Adapted compilation database to clang requirements #162

Closed mkacperek closed 6 years ago

mkacperek commented 6 years ago

Bake already has a feature of generating compilation database in json format (see description in clang docs) but the output was not 100% compliant with clang.

In "file" field bake is now putting absolute paths of source files. In the projects with nested source directories, "directory" shows the main project dir, while the rest of the path is passed with the file name. Clang doesn't support having relative subdirectories in the "file" field, so in order to keep 'directory' and 'command' fields untouched, we need to switch to absolute file paths.

Also the default file name for compilation database has been changed to 'compile_commands.json' - this is the default name used by clang.

Unit tests have been adapted, including reducing code duplication.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 83.115% when pulling 8077be76b43c2b5128ac269b5f1bc20aa7b7021d on mkacperek:master into ce2f8603bc144490a1ef4a0a9133fdfa74dffca7 on esrlabs:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 83.115% when pulling 8077be76b43c2b5128ac269b5f1bc20aa7b7021d on mkacperek:master into ce2f8603bc144490a1ef4a0a9133fdfa74dffca7 on esrlabs:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 83.115% when pulling 8077be76b43c2b5128ac269b5f1bc20aa7b7021d on mkacperek:master into ce2f8603bc144490a1ef4a0a9133fdfa74dffca7 on esrlabs:master.