]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: remove cython 0.29's subinterpreter check during install
authorTim Serong <tserong@suse.com>
Wed, 20 Mar 2019 07:52:14 +0000 (18:52 +1100)
committerNathan Cutler <ncutler@suse.com>
Thu, 11 Jul 2019 08:47:45 +0000 (10:47 +0200)
Commit 3bde34af8a removed cython 0.29's subinterpreter check when
building the various python modules during `make`, but unforunately
they're *rebuilt* during `make install`, with the rebuild overwriting
the original build.  The original fix was of course missing from the
install stage...

Fixes: https://tracker.ceph.com/issues/38788
Signed-off-by: Tim Serong <tserong@suse.com>
(cherry picked from commit 108462e3fb0e814c98ab32f02b79cf3ea1247692)

cmake/modules/Distutils.cmake

index 19de89f97f25ce432fa0ca08c1d4826e9cd0017e..ddccfdca3f4d602fe06a11897407ebdb58d6f731 100644 (file)
@@ -35,6 +35,7 @@ function(distutils_add_cython_module name src)
   get_property(compiler_launcher GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
   get_property(link_launcher GLOBAL PROPERTY RULE_LAUNCH_LINK)
   # This little bit of magic wipes out __Pyx_check_single_interpreter()
+  # Note: this is reproduced in distutils_install_cython_module
   list(APPEND cflags -D'void0=dead_function\(void\)')
   list(APPEND cflags -D'__Pyx_check_single_interpreter\(ARG\)=ARG \#\# 0')
   set(PY_CC \"${compiler_launcher} ${CMAKE_C_COMPILER}\")
@@ -66,7 +67,9 @@ function(distutils_install_cython_module name)
   install(CODE "
     set(ENV{CC} \"${PY_CC}\")
     set(ENV{LDSHARED} \"${PY_LDSHARED}\")
-    set(ENV{CPPFLAGS} \"-iquote${CMAKE_SOURCE_DIR}/src/include\")
+    set(ENV{CPPFLAGS} \"-iquote${CMAKE_SOURCE_DIR}/src/include
+                        -D'void0=dead_function\(void\)' \
+                        -D'__Pyx_check_single_interpreter\(ARG\)=ARG \#\# 0'\")
     set(ENV{LDFLAGS} \"-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\")
     set(ENV{CYTHON_BUILD_DIR} \"${CMAKE_CURRENT_BINARY_DIR}\")
     set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\")