From dbbdd911c3c8a2f703afd8660af1f42fc2374bf6 Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 22 Apr 2024 06:05:53 +0200 Subject: [PATCH] Fixed passing of Debian hardening flags to gcc --- debian/rules | 3 +++ modules/CompilerFlags.cmake | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 21627923..f2f2c8d0 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + VERSION=$(shell dpkg-parsechangelog --show-field Version 2>/dev/null | cut -f1 -d-) VERSION1=$(shell echo ${VERSION} | cut -f1 -d.) VERSION2=$(shell echo ${VERSION} | cut -f2 -d.) diff --git a/modules/CompilerFlags.cmake b/modules/CompilerFlags.cmake index e88e5a85..eaaae121 100644 --- a/modules/CompilerFlags.cmake +++ b/modules/CompilerFlags.cmake @@ -8,7 +8,7 @@ if(NOT WIN32) message(STATUS "using gcc compiler ${CMAKE_CXX_COMPILER_ID}") include (CheckCXXSourceCompiles) - set(CMAKE_CXX_FLAGS "${CXXFLAGS} -W -Wall -Wextra -Werror -Wnon-virtual-dtor -Wno-system-headers") + set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -W -Wall -Wextra -Werror -Wnon-virtual-dtor -Wno-system-headers") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winit-self -Wmissing-include-dirs -Wno-pragmas -Wredundant-decls")