This is an automated email from the ASF dual-hosted git repository.
raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 1dde399523 GH-42017: [CI][Python][C++] Fix utf8proc detection for
wheel on Windows (#42022)
1dde399523 is described below
commit 1dde3995238d4a771c9525e1e5189c1db4a8a95a
Author: Sutou Kouhei <[email protected]>
AuthorDate: Fri Jun 7 17:12:53 2024 +0900
GH-42017: [CI][Python][C++] Fix utf8proc detection for wheel on Windows
(#42022)
### Rationale for this change
utf8proc in vcpkg provides CMake package. If we use it, we don't need to
care about static library name (`utf8proc.lib` or `utf8proc_static.lib`).
### What changes are included in this PR?
Use `unofficial-utf8proc` CMake package with vcpkg.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
* GitHub Issue: #42017
Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
---
cpp/cmake_modules/Findutf8proc.cmake | 2 +-
cpp/cmake_modules/ThirdpartyToolchain.cmake | 12 +++++++-----
cpp/cmake_modules/Usevcpkg.cmake | 3 ---
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/cpp/cmake_modules/Findutf8proc.cmake
b/cpp/cmake_modules/Findutf8proc.cmake
index e347414090..9721f76f06 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_TOOLCHAIN)
set(find_package_args "")
if(utf8proc_FIND_VERSION)
list(APPEND find_package_args ${utf8proc_FIND_VERSION})
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index f102c7bb81..3c58ba649c 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -2819,11 +2819,13 @@ macro(build_utf8proc)
endmacro()
if(ARROW_WITH_UTF8PROC)
- resolve_dependency(utf8proc
- PC_PACKAGE_NAMES
- libutf8proc
- REQUIRED_VERSION
- "2.2.0")
+ set(utf8proc_resolve_dependency_args utf8proc PC_PACKAGE_NAMES libutf8proc)
+ if(NOT VCPKG_TOOLCHAIN)
+ # utf8proc in vcpkg doesn't provide version information:
+ # https://github.com/microsoft/vcpkg/issues/39176
+ list(APPEND utf8proc_resolve_dependency_args REQUIRED_VERSION "2.2.0")
+ endif()
+ resolve_dependency(${utf8proc_resolve_dependency_args})
endif()
macro(build_cares)
diff --git a/cpp/cmake_modules/Usevcpkg.cmake b/cpp/cmake_modules/Usevcpkg.cmake
index 37a732f4b8..b6192468da 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 "")