From: Kefu Chai Date: Tue, 12 Apr 2016 03:49:27 +0000 (+0800) Subject: pybind: silence gcc warnings about '-Wstrict-prototypes' X-Git-Tag: v11.0.0~865^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=48be25426009cf128aa2be511e93b8d45da8958d;p=ceph.git pybind: silence gcc warnings about '-Wstrict-prototypes' this silences following warning ``` warning: cc1plus: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default] ``` * distutils pass "-DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes" to compiler by default if OPT environment variable is not set. so we opt to remove '-Wstrict-prototypes' as we are using c++ as the language of the generated bindinging. * also use "env" to pass the environment variables to avoid unnecessary quote added by distutils, which just breaks the generated CLI command line. Signed-off-by: Kefu Chai --- diff --git a/src/pybind/cephfs/CMakeLists.txt b/src/pybind/cephfs/CMakeLists.txt index 21fcdb55d4b..2981a920b27 100644 --- a/src/pybind/cephfs/CMakeLists.txt +++ b/src/pybind/cephfs/CMakeLists.txt @@ -4,6 +4,7 @@ add_custom_target(cython_cephfs CC=${PY_CC} CXX=${PY_CXX} LDSHARED=${PY_LDSHARED} + OPT=\"-DNDEBUG -g -fwrapv -O2 -Wall\" LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/cephfs CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\" diff --git a/src/pybind/rados/CMakeLists.txt b/src/pybind/rados/CMakeLists.txt index efec92b1d81..8bbe9cef968 100644 --- a/src/pybind/rados/CMakeLists.txt +++ b/src/pybind/rados/CMakeLists.txt @@ -4,6 +4,7 @@ add_custom_target(cython_rados CC=${PY_CC} CXX=${PY_CXX} LDSHARED=${PY_LDSHARED} + OPT=\"-DNDEBUG -g -fwrapv -O2 -Wall\" LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/rados CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\" diff --git a/src/pybind/rbd/CMakeLists.txt b/src/pybind/rbd/CMakeLists.txt index 3757911194c..52400c45004 100644 --- a/src/pybind/rbd/CMakeLists.txt +++ b/src/pybind/rbd/CMakeLists.txt @@ -4,6 +4,7 @@ add_custom_target(cython_rbd CC=${PY_CC} CXX=${PY_CXX} LDSHARED=${PY_LDSHARED} + OPT=\"-DNDEBUG -g -fwrapv -O2 -Wall\" LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/rbd CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\"