SwiftCompilationDatabase produces a compile_commands.json from the Swift compiler.
For tools, like iCompleteMe, that need to invoke the swift compiler outside of a build, JSONCompilationDatabase makes it easy to get all arguments for a file.
Usage
First, build from source
make
SwiftCompilationDatabase relies on the parseable output feature of Swift. Simply run the swift compiler with parseable output enabled ( -parseable-output ), and send the result to SwiftCompilationDatabase.
In practice, this means doing a clean build so all of the frontend invocations are recorded into the database.
SwiftCompilationDatabase
SwiftCompilationDatabase produces a
compile_commands.json
from the Swift compiler.For tools, like iCompleteMe, that need to invoke the swift compiler outside of a build, JSONCompilationDatabase makes it easy to get all arguments for a file.
Usage
First, build from source
SwiftCompilationDatabase relies on the parseable output feature of Swift. Simply run the swift compiler with parseable output enabled (
-parseable-output
), and send the result to SwiftCompilationDatabase.In practice, this means doing a clean build so all of the frontend invocations are recorded into the database.
SwiftPM / Swift Build
SwiftCompilationDatabase works great with SwiftPM and
swift build
.Do a clean build and pipe results
Xcode Usage
To make a compilation database from Xcode, I recommend checking out XcodeCompilationDatabase