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 30, 2024
1 parent 0161435 commit 85c8f71
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, **self.get_platform().settings}
return [f"-D{key}={val}" for (key, val) in all_settings.items()]

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.no_hw_test = False
self.no_hw_build = False
self.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" no_hw_test: {self.no_hw_test}",
f" no_hw_build: {self.no_hw_build}",
f" settings: {self.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 settings(self) -> str:
return self.settings

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

Expand Down

0 comments on commit 85c8f71

Please sign in to comment.