Skip to content

Commit

Permalink
Merge pull request #4599 from mwichmann/compdb_components
Browse files Browse the repository at this point in the history
Fix initialization of compilation_db emitters
  • Loading branch information
bdbaddog authored Sep 16, 2024
2 parents 5d453c2 + 4082db5 commit f700df2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
will now not be deleted from the base environment. Override Environments
now also pretend to have a _dict attribute so that regular environment
methods don't have a problem if passed an OE instance.
- Fix a problem with compilation_db component initialization - the
entries for assembler files were not being set up correctly.


RELEASE 4.8.1 - Tue, 03 Sep 2024 17:22:20 -0700
Expand Down
2 changes: 2 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ FIXES
it always produced True in this case).
- Temporary files created by TempFileMunge() are now cleaned up on
scons exit, instead of at the time they're used. Fixes #4595.
- Fix a problem with compilation_db component initialization - the
entries for assembler files were not being set up correctly.

IMPROVEMENTS
------------
Expand Down
17 changes: 11 additions & 6 deletions SCons/Tool/compilation_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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")
],
),
)

Expand Down

0 comments on commit f700df2

Please sign in to comment.