Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-34921: [C++][Python][Java] Require CMake 3.16 or later #35921

Merged
merged 8 commits into from
Jun 27, 2023
Merged
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
89 changes: 0 additions & 89 deletions ci/docker/linux-apt-jni.dockerfile

This file was deleted.

39 changes: 15 additions & 24 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
message(STATUS "Building using CMake version: ${CMAKE_VERSION}")

# Compiler id for Apple Clang is now AppleClang.
Expand All @@ -37,15 +37,15 @@ cmake_policy(SET CMP0063 NEW)

# RPATH settings on macOS do not affect install_name.
# https://cmake.org/cmake/help/latest/policy/CMP0068.html
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
endif()
cmake_policy(SET CMP0068 NEW)

# find_package() uses <PackageName>_ROOT variables.
# https://cmake.org/cmake/help/latest/policy/CMP0074.html
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
cmake_policy(SET CMP0074 NEW)

# MSVC runtime library flags are selected by an abstraction.
# https://cmake.org/cmake/help/latest/policy/CMP0091.html
cmake_policy(SET CMP0091 NEW)

set(ARROW_VERSION "13.0.0-SNAPSHOT")

Expand Down Expand Up @@ -166,19 +166,15 @@ if("$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" STREQUAL "1"
endif()

# Needed for linting targets, etc.
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonInterp)
else()
# Use the first Python installation on PATH, not the newest one
set(Python3_FIND_STRATEGY "LOCATION")
# On Windows, use registry last, not first
set(Python3_FIND_REGISTRY "LAST")
# On macOS, use framework last, not first
set(Python3_FIND_FRAMEWORK "LAST")
# Use the first Python installation on PATH, not the newest one
set(Python3_FIND_STRATEGY "LOCATION")
# On Windows, use registry last, not first
set(Python3_FIND_REGISTRY "LAST")
# On macOS, use framework last, not first
set(Python3_FIND_FRAMEWORK "LAST")

find_package(Python3)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()
find_package(Python3)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})

# ----------------------------------------------------------------------
# cmake options
Expand Down Expand Up @@ -233,11 +229,6 @@ if(ARROW_USE_CCACHE
endif()
endif()

if(ARROW_USE_PRECOMPILED_HEADERS AND ${CMAKE_VERSION} VERSION_LESS "3.16.0")
message(WARNING "Precompiled headers need CMake 3.16.0 or later, disabling")
set(ARROW_USE_PRECOMPILED_HEADERS OFF)
endif()

if(ARROW_OPTIONAL_INSTALL)
# Don't make the "install" target depend on the "all" target
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
Expand Down
6 changes: 1 addition & 5 deletions cpp/cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,12 @@ function(ADD_ARROW_LIB LIB_NAME)
endif()

if(WIN32
OR (CMAKE_GENERATOR STREQUAL Xcode)
OR CMAKE_VERSION VERSION_LESS 3.12
OR CMAKE_GENERATOR STREQUAL Xcode
OR NOT ARROW_POSITION_INDEPENDENT_CODE)
# We need to compile C++ separately for each library kind (shared and static)
# because of dllexport declarations on Windows.
# The Xcode generator doesn't reliably work with Xcode as target names are not
# guessed correctly.
# We can't use target for object library with CMake 3.11 or earlier.
# See also: Object Libraries:
# https://cmake.org/cmake/help/latest/command/add_library.html#object-libraries
set(USE_OBJLIB OFF)
else()
set(USE_OBJLIB ON)
Expand Down
9 changes: 4 additions & 5 deletions cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,10 @@ takes precedence over ccache if a storage backend is configured" ON)
# one of the other methods, pass -D$NAME_SOURCE=BUNDLED
# * SYSTEM: Use CMake's find_package and find_library without any custom
# paths. If individual packages are on non-default locations, you can pass
# $NAME_ROOT arguments to CMake, or set environment variables for the same
# with CMake 3.11 and higher. If your system packages are in a non-default
# location, or if you are using a non-standard toolchain, you can also pass
# ARROW_PACKAGE_PREFIX to set the *_ROOT variables to look in that
# directory
# $NAME_ROOT arguments to CMake, or set environment variables for the same.
# If your system packages are in a non-default location, or if you are using
# a non-standard toolchain, you can also pass ARROW_PACKAGE_PREFIX to set
# the *_ROOT variables to look in that directory
# * CONDA: Same as SYSTEM but set all *_ROOT variables to
# ENV{CONDA_PREFIX}. If this is run within an active conda environment,
# then ENV{CONDA_PREFIX} will be used for dependencies unless
Expand Down
106 changes: 0 additions & 106 deletions cpp/cmake_modules/FindNumPy.cmake

This file was deleted.

17 changes: 4 additions & 13 deletions cpp/cmake_modules/FindPython3Alt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,10 @@ if(Python3Alt_FIND_QUIETLY)
list(APPEND Python3Alt_NumPy_FIND_PACKAGE_OPTIONS QUIET)
endif()

# Need CMake 3.15 or later for Python3_FIND_STRATEGY
if(${CMAKE_VERSION} VERSION_LESS "3.15.0")
find_package(PythonLibsNew ${Python3Alt_FIND_PACKAGE_OPTIONS})
find_package(NumPy ${Python3Alt_NumPy_FIND_PACKAGE_OPTIONS})
find_package_handle_standard_args(
Python3Alt REQUIRED_VARS PYTHON_EXECUTABLE PYTHON_INCLUDE_DIRS NUMPY_INCLUDE_DIRS)
return()
endif()

if(${CMAKE_VERSION} VERSION_LESS "3.18.0" OR ARROW_BUILD_TESTS)
# When building arrow-python-test, we need libpython to be present, so ask for
# the full "Development" component. Also ask for it on CMake < 3.18,
# where "Development.Module" is not available.
if(CMAKE_VERSION VERSION_LESS 3.18.0)
# We need libpython to be present, so ask for the full "Development"
# component on CMake < 3.18, where "Development.Module" is not
# available.
find_package(Python3 ${Python3Alt_FIND_PACKAGE_OPTIONS} COMPONENTS Interpreter
Development NumPy)
else()
Expand Down
Loading