Reuse compile_commands.json to avoid long recompilations

Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
Somebody Master 2023-02-27 21:38:07 +01:00
parent 44661d11f0
commit 6645cea4fc
Signed by: somebody_master
GPG Key ID: 78315CFDF0B25505

View File

@ -73,13 +73,12 @@ function build() {
# Analize build process to create compile_commands.json
function build_db() {
clean "$_default_platform"
cd "$_build_folder" || clean_exit 1 "$_error_build_folder"
bear -- scons platform="$_default_platform"
if [ ! -f "../{$_bin_folder}/compile_commands.json" ]; then
cd "../$_bin_folder" || clean_exit 1 "$_error_bin_folder"
ln -s "../${_build_folder}/compile_commands.json" ./
if [ ! -f "../${_bin_folder}/compile_commands.json" ]; then
bear --output "../${_bin_folder}/compile_commands.json" -- scons platform="$_default_platform"
else
bear --append --output "../${_bin_folder}/compile_commands.json" -- scons platform="$_default_platform"
fi
cd ..