Update compdb to put full path to compiler

Some language servers (vscode) seem to have started to rely on the
compiler being an absolute path recently. This updates the compdb
generator to match this expectation.

Bug: https://github.com/Microsoft/vscode-cpptools/issues/3112
Test: m nothing && m SOONG_GEN_COMPDB=1 SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
Test: Open vscode
Change-Id: Id146d69c2b808b23896132bbd4bc38ed5c7fd9c7
This commit is contained in:
Alex Light 2019-01-28 19:18:33 -08:00
parent 0425aa13ec
commit e812818656
1 changed files with 2 additions and 2 deletions

View File

@ -170,14 +170,14 @@ func generateCompdbProject(compiledModule CompiledInterface, ctx android.Singlet
return
}
pathToCC, err := ctx.Eval(pctx, "${config.ClangBin}/")
rootDir := getCompdbAndroidSrcRootDirectory(ctx)
pathToCC, err := ctx.Eval(pctx, rootDir+"/${config.ClangBin}/")
ccPath := "/bin/false"
cxxPath := "/bin/false"
if err == nil {
ccPath = pathToCC + "clang"
cxxPath = pathToCC + "clang++"
}
rootDir := getCompdbAndroidSrcRootDirectory(ctx)
for _, src := range srcs {
if _, ok := builds[src.String()]; !ok {
builds[src.String()] = compDbEntry{