diff --git a/pycheribuild/config/target_info.py b/pycheribuild/config/target_info.py index 6e0e8510b..7ae1bf29a 100644 --- a/pycheribuild/config/target_info.py +++ b/pycheribuild/config/target_info.py @@ -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: + 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 diff --git a/pycheribuild/projects/cmake_project.py b/pycheribuild/projects/cmake_project.py index 37d8cd78b..552a63abe 100644 --- a/pycheribuild/projects/cmake_project.py +++ b/pycheribuild/projects/cmake_project.py @@ -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( diff --git a/pycheribuild/projects/simple_project.py b/pycheribuild/projects/simple_project.py index 328eb90a7..d679b440f 100644 --- a/pycheribuild/projects/simple_project.py +++ b/pycheribuild/projects/simple_project.py @@ -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)