Skip to content

Conversation

dblsaiko
Copy link

Targets which use multiple input files only have their first input file show up in the compilation database. This can cause issues with tools that build a list of files to inspect from the compilation database. For example, when using the Swift programming language together with the SourceKit-LSP language server, only one source file from each Swift module gets processed correctly by the language server using the current compilation database output from Ninja, because Swift modules are compiled with one compiler invocation and therefore one Ninja target for the whole module.

This changes the compilation database formatter to emit one entry for each input file of a target instead of just the first input file, which makes tools able to pick up all the input files used in the build.

Fixes #1590.
See also mesonbuild/meson#14264.

Targets which use multiple input files only have their first input
file show up in the compilation database. This can cause issues with
tools that build a list of files to inspect from the compilation
database. For example, when using the Swift programming language
together with the SourceKit-LSP language server, only one source file
from each Swift module gets processed correctly by the language server
using the current compilation database output from Ninja, because Swift
modules are compiled with one compiler invocation and therefore one
Ninja target for the whole module.

This changes the compilation database formatter to emit one entry
for each input file of a target instead of just the first input
file, which makes tools able to pick up all the input files used in
the build.

Fixes ninja-build#1590.
See also mesonbuild/meson#14264.
@dblsaiko
Copy link
Author

Fixed the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

the compilation database only contains the first file/output
1 participant