mirror of
https://github.com/ceph/ceph
synced 2025-02-22 18:47:18 +00:00
cmake/modules: avoid using distutils
to address following warning from python 3.9: <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives <string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead Signed-off-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
parent
f0fc04fbea
commit
637dd7b404
@ -64,7 +64,7 @@ function(distutils_add_cython_module target name src)
|
||||
set(PY_LDSHARED ${link_launcher} ${CMAKE_C_COMPILER} ${c_compiler_arg1} "-shared")
|
||||
|
||||
execute_process(COMMAND "${Python3_EXECUTABLE}" -c
|
||||
"from distutils import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))"
|
||||
"import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE ext_suffix
|
||||
ERROR_VARIABLE error
|
||||
|
@ -32,7 +32,14 @@ endif(CMAKE_INSTALL_PREFIX)
|
||||
|
||||
execute_process(
|
||||
COMMAND
|
||||
${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(prefix='${PYTHON_INSTALL_TEMPLATE}'))"
|
||||
${Python3_EXECUTABLE} -c
|
||||
"import sysconfig;\
|
||||
print(\
|
||||
sysconfig.get_path(\
|
||||
name='purelib',\
|
||||
vars=\
|
||||
{'base': '${PYTHON_INSTALL_TEMPLATE}',\
|
||||
'py_version_short': sysconfig.get_config_var('py_version_short')}))"
|
||||
OUTPUT_VARIABLE "PYTHON3_INSTDIR"
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user