Enable compilation database for Scons

This is necessary for interfacing with external tools such as clang-tidy
This commit is contained in:
JJ Marr 2024-11-22 13:05:37 -05:00 committed by Gunter Labes
parent 1cf3fed50f
commit e9e40b5a37
2 changed files with 7 additions and 0 deletions

1
.gitignore vendored
View file

@ -127,6 +127,7 @@ wesnoth.plg
*.exe
*.dll
*.so
compile_commands.json
# library files
.libs

View file

@ -120,6 +120,7 @@ opts.AddVariables(
BoolVariable("OS_ENV", "Forward the entire OS environment to scons", False),
BoolVariable("history", "Clear to disable GNU history support in lua console", True),
BoolVariable('force_color', 'Always produce ANSI-colored output (GNU/Clang only).', False),
BoolVariable('compile_db', 'Produce a compile_commands.json file.', False),
)
#
@ -189,6 +190,11 @@ if env['distcc']:
if env['ccache']: env.Tool('ccache')
if env['compile_db']:
env.Tool('compilation_db')
cdb = env.CompilationDatabase()
Alias('cdb', cdb)
boost_version = "1.67"
def SortHelpText(a, b):