Skip to content

Commit 2e30554

Browse files
committed
Allow building CMake against newer libuv
1 parent 5169c3b commit 2e30554

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pycheribuild/projects/cmake.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,12 @@ def setup(self):
132132
# Prefer static libraries for 3rd-party dependencies
133133
self.add_cmake_options(BUILD_SHARED_LIBS=False)
134134
self.add_cmake_options(CMAKE_USE_SYSTEM_LIBRARY_LIBUV=True)
135-
# CMake can't find the static libuv due to a different libname
136-
self.add_cmake_options(
137-
LibUV_LIBRARY=BuildLibuv.get_install_dir(self) / self.target_info.default_libdir / "libuv_a.a"
138-
)
135+
if not (BuildLibuv.get_install_dir(self) / self.target_info.default_libdir / "libuv.a").exists():
136+
# CMake can't find the static libuv due to a different libname which is installed as libuv_a.a
137+
# for some older versions of libuv.
138+
self.add_cmake_options(
139+
LibUV_LIBRARY=BuildLibuv.get_install_dir(self) / self.target_info.default_libdir / "libuv_a.a"
140+
)
139141

140142
def run_tests(self):
141143
# TODO: generate JUnit output once https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6020 is merged

0 commit comments

Comments
 (0)