From 4072a6e4456bf82e6e7f300406bcd3ea40f08b6c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Nov 2023 21:43:45 +0100 Subject: [PATCH] python/build/cmake.py: add CMAKE_FIND_ROOT_PATH on Windows Works around CURL build failure because cmake insists on using /usr/include/zlib.h. --- python/build/cmake.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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: