Skip to content

Commit

Permalink
apacheGH-42017: [CI][Python][C++] Fix utf8proc detection for wheel on…
Browse files Browse the repository at this point in the history
… Windows (apache#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: apache#42017

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
  • Loading branch information
kou authored Jun 7, 2024
1 parent b51e997 commit 1dde399
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cpp/cmake_modules/Findutf8proc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
12 changes: 7 additions & 5 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions cpp/cmake_modules/Usevcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down

0 comments on commit 1dde399

Please sign in to comment.