Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions ci/appveyor-cpp-build-mingw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ pushd %CPP_BUILD_DIR%

cmake ^
-G "MSYS Makefiles" ^
-DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
-DARROW_BUILD_STATIC=OFF ^
-DARROW_VERBOSE_THIRDPARTY_BUILD=OFF ^
-DARROW_BUILD_TESTS=ON ^
-DARROW_PACKAGE_PREFIX=%MINGW_PREFIX% ^
-DARROW_USE_GLOG=OFF ^
-DARROW_PARQUET=ON ^
-DARROW_PYTHON=ON ^
-DARROW_USE_GLOG=OFF ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
-DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ^
-DPythonInterp_FIND_VERSION=ON ^
-DPythonInterp_FIND_VERSION_MAJOR=3 ^
-DARROW_BUILD_TESTS=ON ^
.. || exit /B
make -j4 || exit /B
setlocal
Expand Down
2 changes: 2 additions & 0 deletions ci/appveyor-cpp-setup-mingw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pacman --sync --noconfirm ^
%MINGW_PACKAGE_PREFIX%-flatbuffers ^
%MINGW_PACKAGE_PREFIX%-gflags ^
%MINGW_PACKAGE_PREFIX%-gobject-introspection ^
%MINGW_PACKAGE_PREFIX%-grpc ^
%MINGW_PACKAGE_PREFIX%-gtest ^
%MINGW_PACKAGE_PREFIX%-gtk-doc ^
%MINGW_PACKAGE_PREFIX%-lz4 ^
Expand All @@ -52,6 +53,7 @@ pacman --sync --noconfirm ^
%MINGW_PACKAGE_PREFIX%-rapidjson ^
%MINGW_PACKAGE_PREFIX%-snappy ^
%MINGW_PACKAGE_PREFIX%-thrift ^
%MINGW_PACKAGE_PREFIX%-uriparser ^
%MINGW_PACKAGE_PREFIX%-zlib ^
%MINGW_PACKAGE_PREFIX%-zstd || exit /B

Expand Down
1 change: 1 addition & 0 deletions cpp/cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# search there as well.
set(LIB_PATH_SUFFIXES
"${CMAKE_LIBRARY_ARCHITECTURE}"
"lib/${CMAKE_LIBRARY_ARCHITECTURE}"
"lib64"
"lib32"
"lib"
Expand Down
53 changes: 0 additions & 53 deletions cpp/cmake_modules/Finduriparser.cmake

This file was deleted.

96 changes: 96 additions & 0 deletions cpp/cmake_modules/FinduriparserAlt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

if(uriparser_ROOT)
find_library(uriparser_LIB
NAMES uriparser
PATHS ${uriparser_ROOT}
PATH_SUFFIXES ${LIB_PATH_SUFFIXES}
NO_DEFAULT_PATH)
find_path(uriparser_INCLUDE_DIR
NAMES uriparser/Uri.h
PATHS ${uriparser_ROOT}
PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}
NO_DEFAULT_PATH)
else()
set(uriparser_PC_MODULE liburiparser)
if(uriparserAlt_FIND_VERSION)
set(uriparser_PC_MODULE "${uriparser_PC_MODULE} >= ${uriparserAlt_FIND_VERSION}")
endif()
pkg_check_modules(uriparser_PC ${uriparser_PC_MODULE})
if(uriparser_PC_FOUND)
set(uriparser_VERSION "${uriparser_PC_VERSION}")
set(uriparser_INCLUDE_DIR "${uriparser_PC_INCLUDEDIR}")
list(APPEND uriparser_PC_LIBRARY_DIRS "${uriparser_PC_LIBDIR}")
find_library(uriparser_LIB uriparser
PATHS ${uriparser_PC_LIBRARY_DIRS}
PATH_SUFFIXES "${CMAKE_LIBRARY_ARCHITECTURE}"
NO_DEFAULT_PATH)
else()
find_library(uriparser_LIB NAMES uriparser PATH_SUFFIXES ${LIB_PATH_SUFFIXES})
find_path(uriparser_INCLUDE_DIR
NAMES uriparser/Uri.h
PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES})
endif()
endif()

if(NOT uriparser_VERSION AND uriparser_INCLUDE_DIR)
file(READ "${uriparser_INCLUDE_DIR}/uriparser/UriBase.h" uriparser_URI_BASE_H_CONTENT)
string(REGEX MATCH "#define URI_VER_MAJOR +[0-9]+" uriparser_MAJOR_VERSION_DEFINITION
"${uriparser_URI_BASE_H_CONTENT}")
string(REGEX
REPLACE "^.+ +([0-9]+)$" "\\1" uriparser_MAJOR_VERSION
"${uriparser_MAJOR_VERSION_DEFINITION}")
string(REGEX MATCH "#define URI_VER_MINOR +[0-9]+" uriparser_MINOR_VERSION_DEFINITION
"${uriparser_URI_BASE_H_CONTENT}")
string(REGEX
REPLACE "^.+ +([0-9]+)$" "\\1" uriparser_MINOR_VERSION
"${uriparser_MINOR_VERSION_DEFINITION}")
string(REGEX MATCH "#define URI_VER_RELEASE +[0-9]+"
uriparser_RELEASE_VERSION_DEFINITION "${uriparser_URI_BASE_H_CONTENT}")
string(REGEX
REPLACE "^.+ +([0-9]+)$" "\\1" uriparser_RELEASE_VERSION
"${uriparser_RELEASE_VERSION_DEFINITION}")
if("${uriparser_MAJOR_VERSION}" STREQUAL ""
OR "${uriparser_MINOR_VERSION}" STREQUAL ""
OR "${uriparser_RELEASE_VERSION}" STREQUAL "")
set(uriparser_VERSION "0.0.0")
else()
set(
uriparser_VERSION

"${uriparser_MAJOR_VERSION}.${uriparser_MINOR_VERSION}.${uriparser_RELEASE_VERSION}"
)
endif()
endif()

find_package_handle_standard_args(uriparserAlt
REQUIRED_VARS
uriparser_LIB
uriparser_INCLUDE_DIR
VERSION_VAR
uriparser_VERSION)

if(uriparserAlt_FOUND)
add_library(uriparser::uriparser UNKNOWN IMPORTED)
set_target_properties(uriparser::uriparser
PROPERTIES IMPORTED_LOCATION "${uriparser_LIB}"
INTERFACE_INCLUDE_DIRECTORIES
"${uriparser_INCLUDE_DIR}"
# URI_STATIC_BUILD required on Windows
INTERFACE_COMPILE_DEFINITIONS "URI_NO_UNICODE")
endif()
29 changes: 23 additions & 6 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ endif()
# ----------------------------------------------------------------------
# Resolve the dependencies

# TODO: add uriparser here when it gets a conda package
set(ARROW_THIRDPARTY_DEPENDENCIES
benchmark
BOOST
Expand All @@ -56,6 +55,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
RapidJSON
Snappy
Thrift
uriparser
ZLIB
ZSTD)

Expand All @@ -78,6 +78,10 @@ if(ARROW_DEPENDENCY_SOURCE STREQUAL "CONDA")
endif()
set(ARROW_ACTUAL_DEPENDENCY_SOURCE "SYSTEM")
message(STATUS "Using CONDA_PREFIX for ARROW_PACKAGE_PREFIX: ${ARROW_PACKAGE_PREFIX}")
# ARROW-5564: Remove this when uriparser gets a conda package
if("${uriparser_SOURCE}" STREQUAL "")
set(uriparser_SOURCE "AUTO")
endif()
else()
set(ARROW_ACTUAL_DEPENDENCY_SOURCE "${ARROW_DEPENDENCY_SOURCE}")
endif()
Expand Down Expand Up @@ -590,13 +594,26 @@ macro(build_uriparser)
endmacro()

if(ARROW_WITH_URIPARSER)
# Unless the user overrides uriparser_SOURCE, build uriparser ourselves
if("${uriparser_SOURCE}" STREQUAL "")
set(uriparser_SOURCE "BUNDLED")
set(ARROW_URIPARSER_REQUIRED_VERSION "0.9.0")
if(uriparser_SOURCE STREQUAL "AUTO")
# Debian does not ship cmake configs for uriparser
find_package(uriparser ${ARROW_URIPARSER_REQUIRED_VERSION} QUIET)
if(NOT uriparser_FOUND)
find_package(uriparserAlt ${ARROW_URIPARSER_REQUIRED_VERSION})
endif()
if(NOT uriparser_FOUND AND NOT uriparserAlt_FOUND)
build_uriparser()
endif()
elseif(uriparser_SOURCE STREQUAL "BUNDLED")
build_rapidjson()
elseif(uriparser_SOURCE STREQUAL "SYSTEM")
# Debian does not ship cmake configs for uriparser
find_package(uriparser ${ARROW_URIPARSER_REQUIRED_VERSION} QUIET)
if(NOT uriparser_FOUND)
find_package(uriparserAlt ${ARROW_URIPARSER_REQUIRED_VERSION} REQUIRED)
endif()
endif()

resolve_dependency(uriparser)

get_target_property(URIPARSER_INCLUDE_DIRS uriparser::uriparser
INTERFACE_INCLUDE_DIRECTORIES)
include_directories(SYSTEM ${URIPARSER_INCLUDE_DIRS})
Expand Down
1 change: 1 addition & 0 deletions run-cmake-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'cpp/cmake_modules/FindgRPCAlt.cmake',
'cpp/cmake_modules/FindgflagsAlt.cmake',
'cpp/cmake_modules/Findjemalloc.cmake',
'cpp/cmake_modules/FinduriparserAlt.cmake',
'cpp/cmake_modules/SetupCxxFlags.cmake',
'cpp/cmake_modules/ThirdpartyToolchain.cmake',
'cpp/cmake_modules/san-config.cmake',
Expand Down