Skip to content

Commit

Permalink
apacheGH-34921: [C++][Python][Java] Require CMake 3.16 or later
Browse files Browse the repository at this point in the history
We need to support Ubuntu 20.04 (CMake 3.16) or later, CentOS 7 (CMake
3.17) or later, and Debian GNU/Linux buster (CMake 3.13 but backports
repository has CMake 3.18) or later.

So we can require CMake 3.16 or later.
  • Loading branch information
kou committed Jun 6, 2023
1 parent 87d0824 commit b9911f9
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 671 deletions.
89 changes: 0 additions & 89 deletions ci/docker/linux-apt-jni.dockerfile

This file was deleted.

27 changes: 9 additions & 18 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 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
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

0 comments on commit b9911f9

Please sign in to comment.