diff --git a/python/build/cmake.py b/python/build/cmake.py index 74d5f286a..12887d3ba 100644 --- a/python/build/cmake.py +++ b/python/build/cmake.py @@ -53,6 +53,14 @@ set(CMAKE_CXX_FLAGS_INIT "{toolchain.cxxflags} {toolchain.cppflags}") set(CMAKE_FIND_ROOT_PATH "{toolchain.install_prefix};{sysroot}") set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +""") + elif cmake_system_name == 'Windows': + # search libraries and headers only in the sysroot, not on + # the build host + f.write(f""" +set(CMAKE_FIND_ROOT_PATH "{toolchain.install_prefix}") +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) """) def configure(toolchain: AnyToolchain, src: str, build: str, args: list[str]=[], env: Optional[Mapping[str, str]]=None) -> None: