From: Kefu Chai Date: Sat, 9 Jul 2016 15:36:14 +0000 (+0800) Subject: cmake: pass necessary cflags to build_ext X-Git-Tag: ses5-milestone5~444^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c57dbd3451d2b7c3bbf81e18738ae1000a4f75cc;p=ceph.git cmake: pass necessary cflags to build_ext this fixes: ``` creating /home/kefu/ceph/build/src/pybind/rados/var/ceph/ceph/build/src/pybind/rados creating /home/kefu/ceph/build/src/pybind/rados/var/ceph/ceph/build/src/pybind/rados/pyrex /usr/bin/gcc-6 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -iquote /var/ceph/ceph/src/include -fPIC -I/usr/include/python2.7 -I/usr/include/x86_64-linux- gnu/python2.7 -I/usr/include/python2.7 -c /home/kefu/ceph/build/src/pybind/rados/pyrex/rados.c -o /home/kefu/ceph/build/src/pybind/rados/var/ceph/ceph/build/src/pybind/rados/pyrex/ra dos.o -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -lpython2. 7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions /home/kefu/ceph/build/src/pybind/rados/pyrex/rados.c:239:28: fatal error: rados/librados.h: No such file or directory #include "rados/librados.h" ^ compilation terminated. ``` seems we can not pass the CFLAGS with space in it to setup.py using env variable Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake index aefcf707e7f04..f2e4b34a3fe63 100644 --- a/cmake/modules/Distutils.cmake +++ b/cmake/modules/Distutils.cmake @@ -67,7 +67,8 @@ function(distutils_install_cython_module name) CYTHON_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR} CEPH_LIBDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CC=${CMAKE_C_COMPILER} - CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\" + CPPFLAGS=\"-iquote${CMAKE_SOURCE_DIR}/src/include\" + LDFLAGS=\"-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\" ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose build_ext --cython-c-in-temp --build-temp ${CMAKE_CURRENT_BINARY_DIR} --cython-include-dirs ${PROJECT_SOURCE_DIR}/src/pybind/rados