This solves linter warnings in editor by adding flags to ignore errors
we don't care about. This also means that compile_commands.json is
closer to the flags we actually use for compilation.
Test: Checked generated compile_commands for new flags.
Change-Id: Id583da6eb5151a9baa9a47771f5f937c88bc43f7
This relands I12a0f907753fefd1997ab8b4ea2ac331234093cf along with
a fix to blueprint for absolute paths.
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.
Change-Id: I24ac485677aa102eec1a2521d16820da6ee1ae77
Fixes: 146437378
Test: m checkbuild
Test: m OUT_DIR=/tmp/out nothing
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.
Fixes: 146437378
Test: m checkbuild
Change-Id: I12a0f907753fefd1997ab8b4ea2ac331234093cf
This change modifies the location of generated compdb file from
$ANDROID_BUILD_TOP to where compdbOtuputProjectsDirectory points to,
under $OUT_DIR. This is especially required for the build environment
that maps $ANDROID_BUILD_TOP as read-only, such as Gitc.
Test: m SOONG_GEN_COMPDB=1 nothing
examine generated compile_commands.json
Signed-off-by: Changyeon Jo <changyeon@google.com>
Change-Id: I86700f89b613a443a33982ecd5501b0f68a62be7
Native compiler flags are currently applied in approximately:
global cflags
local cflags
local include dirs
global include dirs
global conlyflags
local conlyflags
global cppflags
local cppflags
This means that a flag that is enabled in the global cppflags
cannot be disabled in the local cflags, and an Android.bp author
must know to disable it in the local cppflags. A better order
would be:
global cflags
global conlyflags
global cppflags
local cflags
local conlyflags
local cppflags
local include dirs
global include dirs
We are mixing both the global and local cflags into a single
variable, and similar for conlyflags and cppflags, which
prevents reordering them. This CL prepares to reorder them
by splitting the global and local cflags into separate variables.
Bug: 143713277
Test: m native
Change-Id: Ic55a8c3516c331dc5f2af9d00e59ceca9d3e6c15
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
Some tools (eg ccls) require that the compiler in argv[0] of the
compdb be an actual compiler binary. Until now we had simply filled
that slot with /bin/false. This change fills it with the current
default clang binary instead.
Test: make -j50 SOONG_GEN_COMPDB=1 SOONG_GEN_COMPDB_DEBUG=1 SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
Test: Use ccls
Change-Id: I920e8d3113e398b629228070a904dbf1535856e0
compdb.go was incorrectly splitting compiler arguments. This could
cause empty strings to be included in compile_commands.json,
potentially confusing tools.
Bug: 117124308
Test: m checkbuild
Test: m SOONG_GEN_COMPDB=1 \
SOONG_GEN_COMPDB_DEBUG=1 \
SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
Examine $ANDROID_BUILD_TOP/compile_commands.json
Change-Id: I375baf255c50a1329cd644ac584d200aba9daa69
Some tools (i.e. you-complete-me) make use of a 'compdb' file
(compile_commands.json) that records (among other things) the
arguments needed to compile a file. These tools can use this with
libclang to provide semantic completions and perform other IDE
actions. This CL adds support for soong to generate a (simple)
compile_commands.json file.
Test: make SOONG_GEN_COMPDB=1 SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
examine $ANDROID_BUILD_TOP/compile_commands.json
Change-Id: I751bb344b90dfcdad1dfd71c2a85bacd345f0464