From e81281865672b80c21dfbdfbc07246335caa0186 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Mon, 28 Jan 2019 19:18:33 -0800 Subject: [PATCH] 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 --- cc/compdb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cc/compdb.go b/cc/compdb.go index 4dfc55b6d..110265174 100644 --- a/cc/compdb.go +++ b/cc/compdb.go @@ -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{