]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerTim Serong <tserong@suse.com>
Wed, 20 Mar 2019 07:56:43 +0000 (18:56 +1100)
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>
cmake/modules/Distutils.cmake

index 5697dff85fe91676ac8c3281b5749f4ffcfda500..f70265fe4c7afc2fc81adc53ae06a464a12a9790 100644 (file)
@@ -50,6 +50,7 @@ function(distutils_add_cython_module name src)
   string(REPLACE " " ";" cflags ${CMAKE_C_FLAGS})
   list(APPEND cflags -iquote${CMAKE_SOURCE_DIR}/src/include -w)
   # 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} ${c_compiler_arg1} ${cflags})
@@ -80,7 +81,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}\")