From 48f33198df307dc454001e9e0b52090f31bf5c88 Mon Sep 17 00:00:00 2001 From: Joey Pollack Date: Fri, 31 May 2024 14:27:28 -0400 Subject: [PATCH] Adds code to generate compile_commands.json, run 'scons cdb' to generate it --- .gitignore | 6 ++++++ SConstruct | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 416ea9f..bcba568 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Objects. .scons-cache/ *.os +*.obj + # SConstruct .sconf_temp @@ -12,3 +14,7 @@ # Editors .vscode/ + +# Clangd +.cache/ +compile_commands.json \ No newline at end of file diff --git a/SConstruct b/SConstruct index 8222b88..de4cce2 100644 --- a/SConstruct +++ b/SConstruct @@ -5,6 +5,10 @@ from pathlib import Path # TODO: Do not copy environment after godot-cpp/test is updated . env = SConscript("godot-cpp/SConstruct") +env.Tool('compilation_db') +cdb = env.CompilationDatabase('compile_commands.json') +Alias('cdb', cdb) + # Add source files. env.Append(CPPPATH=["src/"]) sources = Glob("src/*.cpp")