summaryrefslogtreecommitdiffstats
path: root/SCons
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2024-09-16 21:12:22 (GMT)
committerMats Wichmann <mats@linux.com>2024-09-16 21:12:22 (GMT)
commit4082db59a481fad7fe4f4e91847a187044c1db93 (patch)
treecc6486a7f300aaa62f58b8058ac7151f4282f17a /SCons
parent5d453c2200bfd5085514916600f5780b1e7d5488 (diff)
downloadSCons-4082db59a481fad7fe4f4e91847a187044c1db93.zip
SCons-4082db59a481fad7fe4f4e91847a187044c1db93.tar.gz
SCons-4082db59a481fad7fe4f4e91847a187044c1db93.tar.bz2
Fix initialization of compilation_db emitters
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons')
-rw-r--r--SCons/Tool/compilation_db.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py
index e17b5dc..2b1bfb5 100644
--- a/SCons/Tool/compilation_db.py
+++ b/SCons/Tool/compilation_db.py
@@ -43,6 +43,8 @@ from .cxx import CXXSuffixes
from .cc import CSuffixes
from .asm import ASSuffixes, ASPPSuffixes
+DEFAULT_DB_NAME = 'compile_commands.json'
+
# TODO: Is there a better way to do this than this global? Right now this exists so that the
# emitter we add can record all of the things it emits, so that the scanner for the top level
# compilation database can access the complete list, and also so that the writer has easy
@@ -189,9 +191,8 @@ def compilation_db_emitter(target, source, env):
if not target and len(source) == 1:
target = source
- # Default target name is compilation_db.json
if not target:
- target = ['compile_commands.json', ]
+ target = [DEFAULT_DB_NAME]
# No source should have been passed. Drop it.
if source:
@@ -224,13 +225,17 @@ def generate(env, **kwargs) -> None:
),
itertools.product(
ASSuffixes,
- [(static_obj, SCons.Defaults.StaticObjectEmitter, "$ASCOM")],
- [(shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASCOM")],
+ [
+ (static_obj, SCons.Defaults.StaticObjectEmitter, "$ASCOM"),
+ (shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASCOM")
+ ],
),
itertools.product(
ASPPSuffixes,
- [(static_obj, SCons.Defaults.StaticObjectEmitter, "$ASPPCOM")],
- [(shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASPPCOM")],
+ [
+ (static_obj, SCons.Defaults.StaticObjectEmitter, "$ASPPCOM"),
+ (shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASPPCOM")
+ ],
),
)