1
0
mirror of https://github.com/ceph/ceph synced 2025-03-31 07:53:23 +00:00

Merge pull request from tchaikov/wip-cmake-python3-exact

cmake/modules: use exact version of python3 when finding cython

Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Kefu Chai 2022-04-22 07:10:02 +08:00 committed by GitHub
commit 8e7f49c256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 8 deletions

View File

@ -474,12 +474,8 @@ option(WITH_CEPHFS "CephFS is enabled" ON)
if(NOT WIN32)
# Please specify 3.[0-7] if you want to build with a certain version of python3.
set(WITH_PYTHON3 "3" CACHE STRING "build with specified python3 version")
if(NOT WITH_PYTHON3 STREQUAL "3")
set(find_python3_exact "EXACT")
endif()
find_package(Python3 ${WITH_PYTHON3} ${find_python3_exact} REQUIRED
find_package(Python3 ${WITH_PYTHON3} EXACT REQUIRED
COMPONENTS Interpreter Development)
unset(find_python3_exact)
option(WITH_MGR "ceph-mgr is enabled" ON)
if(WITH_MGR)

View File

@ -38,7 +38,6 @@ if(WITH_GTEST_PARALLEL)
BUILD_COMMAND ""
INSTALL_COMMAND "")
add_dependencies(tests gtest-parallel_ext)
find_package(Python3 QUIET REQUIRED)
set(GTEST_PARALLEL_COMMAND
${Python3_EXECUTABLE} ${gtest_parallel_source_dir}/gtest-parallel)
endif()
@ -70,7 +69,6 @@ function(add_tox_test name)
list(APPEND tox_envs py3)
endif()
string(REPLACE ";" "," tox_envs "${tox_envs}")
find_package(Python3 QUIET REQUIRED)
add_test(
NAME setup-venv-for-${name}
COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${Python3_EXECUTABLE} ${venv_path}

View File

@ -6,7 +6,7 @@ include(CMakeParseArguments)
# the building host happens to have a higher version of python3, that version
# would be picked up instead by find_package(Python3). and that is not want we
# expect.
find_package(Python3 ${WITH_PYTHON3}
find_package(Python3 ${WITH_PYTHON3} EXACT
QUIET
REQUIRED
COMPONENTS Interpreter)