[Pkg-cmake-team] Bug#653916: cmake doesn't read $CPPFLAGS, ignores some hardening flags
Samuel Thibault
sthibault at debian.org
Thu Dec 31 15:34:19 GMT 2020
Modestas Vainius, le lun. 27 févr. 2012 00:54:52 +0200, a ecrit:
> The plan how to solve this problem properly on the cmake side has been
> outlined in the upstream bug report [1]. The rest [2] will have to be done by
> package maintainers / dh / cdbs.
>
> [1] http://www.cmake.org/Bug/view.php?id=12928#c28716
> [2] -DCMAKE_POLICY_DEFAULT_CMPNNNN=NEW
FTR, we are missing CPPFLAGS in the "c++ -dM -E" commands:
https://salsa.debian.org/debian/vite/-/jobs/1298406
353:CPPFLAGS missing (-D_FORTIFY_SOURCE=2): /usr/lib/ccache/c++ -dM -E -c /usr/share/cmake-3.18/Modules/CMakeCXXCompilerABI.cpp -DMT_PARSING -DQT_CHARTS_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -I/usr/include/open-trace-format -I/builds/debian/vite/debian/output/source_dir/obj-x86_64-linux-gnu/src/common -I/builds/debian/vite/debian/output/source_dir/obj-x86_64-linux-gnu/src -I/builds/debian/vite/debian/output/source_dir/src -I/builds/debian/vite/debian/output/source_dir/externals/qtcolorpicker/src -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/usr/include/x86_64-linux-gnu/qt5/QtXml -I/usr/include/x86_64-linux-gnu/qt5/QtOpenGL -I/usr/include/x86_64-linux-gnu/qt5/QtUiTools -I/usr/include/x86_64-linux-gnu/qt5/QtCharts -I/usr/include/x86_64-linux-gnu/qt5/QtSvg -I/usr/include/c++/10 -I/usr/include/x86_64-linux-gnu/c++/10 -I/usr/include/c++/10/backward -I/usr/lib/gcc/x86_64-linux-gnu/10/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include
I circumvented the issue by passing
-DCMAKE_CXX_COMPILER_ARG1="$(CPPFLAGS)" to cmake
Samuel
More information about the Pkg-cmake-team
mailing list