From 76904bd19b678af33f1b23c9c47b36b5d4f7c879 Mon Sep 17 00:00:00 2001 From: flysand7 Date: Fri, 28 Jul 2023 21:52:12 +1100 Subject: [PATCH] Handle inter-module dependencies --- build.py | 12 +++++++++--- src/library.json | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 03b775b..fed0ef8 100755 --- a/build.py +++ b/build.py @@ -161,19 +161,25 @@ try: ciabatta_header.write(f'#include <{include}>\n') ciabatta_header.write('\n') # Write module sources + mod_exports = [] for api in library_config['apis']: api_name = api['name'] api_path = api['path'] - tinyrt_satisfied = True + reqs_satisfied = True + # Check API dependencies for req in api['reqs']: if not (req in tinyrt_apis): - tinyrt_satisfied = False + reqs_satisfied = False break - if not tinyrt_satisfied: + if not (req in mod_exports): + reqs_satisfied = False + break + if not reqs_satisfied: print(f" -> Not exporting API '{api_name}'") else: print(f" * Exporting API '{api_name}'") ciabatta_header.write(f'// Module {api_name}\n') + mod_exports.append(api_name) for include in api['includes']: ciabatta_header.write(f'#include "{api_path}/{include}"\n') except Exception as error: diff --git a/src/library.json b/src/library.json index df0b7fc..2e895b8 100644 --- a/src/library.json +++ b/src/library.json @@ -74,6 +74,7 @@ apis: [ ], reqs: [ "rt_api_program", + "cia_memory", ] }, {