Skip to content

Commit

Permalink
Add support for building a particular profile for a target
Browse files Browse the repository at this point in the history
Add a --profile switch to build_rts.py to allow us to specify which profile
to build for a target. By default, the script will create and build runtimes
for all supported profiles. The new --profile switch allows us to create
just the runtime that is being requested by a customer.

Issue: eng/toolchain/bb-runtimes#73
  • Loading branch information
burratoo committed Jul 26, 2024
1 parent 151d247 commit 50f0392
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
11 changes: 10 additions & 1 deletion build_rts.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ def main():
parser.add_argument(
"target", nargs="+", help="List of target boards to generate runtimes for"
)
parser.add_argument(
"--profiles",
type=str,
help="Comma seperated list of profiles to generate runtimes for",
)
args = parser.parse_args()

if args.verbose:
Expand Down Expand Up @@ -417,7 +422,11 @@ def main():
print("install runtime sources for %s" % board.name)
sys.stdout.flush()
installer = Installer(board)
projects += installer.install(dest, rts_descriptor=args.rts_src_descriptor)
projects += installer.install(
dest,
rts_descriptor=args.rts_src_descriptor,
profiles=args.profiles.split(","),
)

# and build them
if args.build:
Expand Down
7 changes: 6 additions & 1 deletion support/bsp_sources/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _get_rts_dirs(self, rts_source_item, scenarios):
ret += self._get_rts_dirs(sub, scenarios)
return ret

def install(self, destination, rts_descriptor=None):
def install(self, destination, rts_descriptor=None, profiles=None):
# Build target directories
destination = os.path.abspath(destination)
if not os.path.exists(destination):
Expand All @@ -183,6 +183,11 @@ def install(self, destination, rts_descriptor=None):
projects = []

for rts_base_name, rts_obj in self.tgt.runtimes.items():
# If we have been given a list of profiles, skip the profiles that
# are not in the list.
if profiles is not None and rts_base_name not in profiles:
continue

if self.tgt.is_native or self.tgt.is_legacy_format:
rtsname = "rts-%s" % rts_base_name
if self.tgt.name.endswith("vx7r2cert-rtp"):
Expand Down
2 changes: 1 addition & 1 deletion support/bsp_sources/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def dump_runtime_xml(self, rts_name, rts):

ret += "\n"

for lang in ("Ada", "C", "Asm", "Asm2", "Asm_Cpp"):
for lang in ("Ada", "C", "C++", "Asm", "Asm2", "Asm_Cpp"):
w = " "
ret += w + 'for Leading_Required_Switches ("%s") use\n' % lang
w = " "
Expand Down

0 comments on commit 50f0392

Please sign in to comment.