diff --git a/api/python/backend/config.py b/api/python/backend/config.py index 3b67a341ba..21b29c82e4 100644 --- a/api/python/backend/config.py +++ b/api/python/backend/config.py @@ -25,6 +25,8 @@ class BuildConfig(BaseModel): extra_cmake: Union[List[str], str] = Field(None, alias="extra-cmake-opt") lief_install_dir: Optional[str] = Field(None, alias="lief-install-dir") py_api: str = Field("", alias="py-api") + c_compiler: str | None = Field(None, alias="c-compiler") + cxx_compiler: str | None = Field(None, alias="cxx-compiler") @property def targets(self) -> List[str]: @@ -57,6 +59,16 @@ def cmake_dump(self) -> List[str]: f"-DLIEF_DIR={lief_dir.as_posix()}" )) + if self.c_compiler is not None: + out.append( + f"-DCMAKE_C_COMPILER={self.c_compiler}" + ) + + if self.cxx_compiler is not None: + out.append( + f"-DCMAKE_CXX_COMPILER={self.cxx_compiler}" + ) + return out class ThridParty(BaseModel):