Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass compiler/linker flags to CMake for -native-hybrid #386

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pycheribuild/config/target_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,9 @@ def is_native(self) -> bool:
assert self.target_info_cls is not None
return self.target_info_cls.is_native()

def is_native_hybrid(self) -> bool:
arichardson marked this conversation as resolved.
Show resolved Hide resolved
return self.is_native() and self._is_cheri_hybrid

def _check_arch(self, arch: CPUArchitecture, include_purecap: "Optional[bool]") -> bool:
if self.cpu_architecture is not arch:
return False
Expand Down
2 changes: 1 addition & 1 deletion pycheribuild/projects/cmake_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def setup_late(self):
CMAKE_CXX_COMPILER=self.CXX,
CMAKE_ASM_COMPILER=self.CC, # Compile assembly files with the default compiler
)
if not self.compiling_for_host():
if not self.compiling_for_host() or self.compiling_for_host_hybrid():
# Add compiler/linker flags (for cross-compilation these are defined in the toolchain file).
# Note: All of these should be commandlines not CMake lists.
self.add_cmake_options(
Expand Down
3 changes: 3 additions & 0 deletions pycheribuild/projects/simple_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,9 @@ def compiling_for_cheri_hybrid(self, valid_cpu_archs: "Optional[list[CPUArchitec
def compiling_for_host(self) -> bool:
return self.crosscompile_target.is_native()

def compiling_for_host_hybrid(self) -> bool:
return self.crosscompile_target.is_native_hybrid()

def compiling_for_riscv(self, include_purecap: bool) -> bool:
return self.crosscompile_target.is_riscv(include_purecap=include_purecap)

Expand Down