diff options
author | Kefu Chai <kchai@redhat.com> | 2019-07-08 14:15:39 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2019-07-08 14:30:14 +0200 |
commit | 1468c8fc350c1144e56fd328df02e8777628d213 (patch) | |
tree | 079c9949e07ba1157166c0369e6c0926e0c7688e /cmake/modules/Distutils.cmake | |
parent | cmake/modules/Distutils.cmake: avoid rebuilding cython ext (diff) | |
download | ceph-1468c8fc350c1144e56fd328df02e8777628d213.tar.xz ceph-1468c8fc350c1144e56fd328df02e8777628d213.zip |
cmake/modules/Distutils.cmake: add setup as a dependency
so the extension will be rebuilt if setup.py is updated
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'cmake/modules/Distutils.cmake')
-rw-r--r-- | cmake/modules/Distutils.cmake | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake index f72b47b4fda..36eee98e335 100644 --- a/cmake/modules/Distutils.cmake +++ b/cmake/modules/Distutils.cmake @@ -72,6 +72,7 @@ function(distutils_add_cython_module target name src) message(FATAL_ERROR "Unable to tell python extension's suffix: ${error}") endif() set(output_dir "${CYTHON_MODULE_DIR}/lib.${PYTHON${PYTHON_VERSION}_VERSION_MAJOR}") + set(setup_py ${CMAKE_CURRENT_SOURCE_DIR}/setup.py) add_custom_command( OUTPUT ${output_dir}/${name}${ext_suffix} COMMAND @@ -83,10 +84,11 @@ function(distutils_add_cython_module target name src) LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CYTHON_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR} CEPH_LIBDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - ${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py + ${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${setup_py} build --verbose --build-base ${CYTHON_MODULE_DIR} --build-platlib ${output_dir} - DEPENDS ${src} + MAIN_DEPENDENCY ${src} + DEPENDS ${setup_py} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) add_custom_target(${target} ALL DEPENDS ${output_dir}/${name}${ext_suffix}) |