Skip to content

Commit

Permalink
platforms: allow platform specific config flags
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Velickovic <[email protected]>
  • Loading branch information
Ivan-Velickovic committed Jan 18, 2024
1 parent b200781 commit 61d3823
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion seL4-platforms/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def get_mode(self) -> Optional[int]:

def settings_args(self):
"""Return the build settings as an argument list [-Dkey=val]"""
return [f"-D{key}={val}" for (key, val) in self.settings.items()]
all_settings = {**self.settings.items(), **self.get_platform().extra_settings()}
return [f"-D{key}={val}" for (key, val) in all_settings]

def set_verification(self):
"""Make this a verification build"""
Expand Down
5 changes: 5 additions & 0 deletions seL4-platforms/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(self, name: str, entries: dict):
self.req = None
self.disabled = False
self.no_hw_build = False
self.extra_settings = {}
self.__dict__.update(**entries)
if not self.validate():
raise ValidationException(f"Platform {name} validation")
Expand Down Expand Up @@ -109,6 +110,7 @@ def __repr__(self):
f" req: {self.req}",
f" disabled: {self.disabled}",
f" no_hw_build: {self.no_hw_build}",
f" extra_settings: {self.extra_settings}",
" }"
]])
return result.getvalue()
Expand Down Expand Up @@ -158,6 +160,9 @@ def toolchain_arch_str(self) -> str:
def cmake_toolchain_setting(self, mode: int) -> str:
return self.toolchain_arch_str() + str(mode)

def extra_settings(self) -> str:
return self.extra_settings

def get_image_platform(self, mode: int) -> str:
return self.image_platform or self.get_platform(mode)

Expand Down

0 comments on commit 61d3823

Please sign in to comment.