Skip to content

Commit

Permalink
cmake: pass necessary cflags to build_ext
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tchaikov committed Jul 11, 2016
1 parent 6a99eec commit c57dbd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/modules/Distutils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c57dbd3

Please sign in to comment.