Skip to content

Commit

Permalink
Relax dependency check for Ada binding of C/C++
Browse files Browse the repository at this point in the history
A *_hpp.ads or *_h.ads without a corresponding C/C++ dependency found in
the build path now does not error out.
  • Loading branch information
dinkelk committed Oct 7, 2024
1 parent 3b09152 commit 0fb64a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions redo/rules/build_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,14 @@ def _get_all_dependencies(source_files):
for source in new_ads_sources:
if source.endswith("_h.ads"):
with c_source_database() as db:
c_sources.extend(db.get_sources([os.path.basename(source[:-6])]))
binded_sources = db.try_get_sources([os.path.basename(source[:-6])])
if binded_sources:
c_sources.extend(binded_sources)
if source.endswith("_hpp.ads"):
with c_source_database() as db:
c_sources.extend(db.get_sources([os.path.basename(source[:-8])]))
binded_sources = db.try_get_sources([os.path.basename(source[:-8])])
if binded_sources:
c_sources.extend(binded_sources)
if c_sources:
redo.redo_ifchange(c_sources)
deps.extend(c_sources)
Expand Down

0 comments on commit 0fb64a5

Please sign in to comment.