From e261175c052dba5f3979ba009ffed11f025a28ac Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Fri, 7 Jun 2024 06:01:06 +0900 Subject: [PATCH] GH-42017: [CI][Python][C++] Fix utf8proc detection for wheel on Windows --- cpp/cmake_modules/Findutf8proc.cmake | 7 ++++++- cpp/cmake_modules/Usevcpkg.cmake | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cpp/cmake_modules/Findutf8proc.cmake b/cpp/cmake_modules/Findutf8proc.cmake index e347414090549..65d9e1fae5200 100644 --- a/cpp/cmake_modules/Findutf8proc.cmake +++ b/cpp/cmake_modules/Findutf8proc.cmake @@ -19,7 +19,7 @@ if(utf8proc_FOUND) return() endif() -if(ARROW_PACKAGE_KIND STREQUAL "vcpkg") +if(ARROW_PACKAGE_KIND STREQUAL "vcpkg" OR VCPKG_ROOT) set(find_package_args "") if(utf8proc_FIND_VERSION) list(APPEND find_package_args ${utf8proc_FIND_VERSION}) @@ -33,6 +33,11 @@ if(ARROW_PACKAGE_KIND STREQUAL "vcpkg") find_package(utf8proc NAMES unofficial-utf8proc ${find_package_args}) if(utf8proc_FOUND) add_library(utf8proc::utf8proc ALIAS utf8proc) + if(NOT utf8proc_VERSION) + # vcpkg's CMake package doesn't provide version. + # It's supported since 2.7.0. So we use 2.7.0 for now. + set(utf8proc_VERSION "2.7.0") + endif() return() endif() endif() diff --git a/cpp/cmake_modules/Usevcpkg.cmake b/cpp/cmake_modules/Usevcpkg.cmake index 37a732f4b85a0..b6192468da342 100644 --- a/cpp/cmake_modules/Usevcpkg.cmake +++ b/cpp/cmake_modules/Usevcpkg.cmake @@ -237,9 +237,6 @@ set(LZ4_ROOT CACHE STRING "") if(CMAKE_HOST_WIN32) - set(utf8proc_MSVC_STATIC_LIB_SUFFIX - "" - CACHE STRING "") set(LZ4_MSVC_LIB_PREFIX "" CACHE STRING "")