Enable compilation database for Scons
This is necessary for interfacing with external tools such as clang-tidy
This commit is contained in:
parent
1cf3fed50f
commit
e9e40b5a37
2 changed files with 7 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -127,6 +127,7 @@ wesnoth.plg
|
|||
*.exe
|
||||
*.dll
|
||||
*.so
|
||||
compile_commands.json
|
||||
|
||||
# library files
|
||||
.libs
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue