From fcca4bc3e6aebf2735c29c98e8abb65bdd4ae19d Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Thu, 22 Apr 2021 22:08:00 +0100 Subject: [PATCH] Add a new warnings variable that can be used for injecting new warnings This variable can be used to add in more warnings to the compilation that only apply to the KiCad code and not the SWIG or third-party code. --- CMakeModules/Warnings.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeModules/Warnings.cmake b/CMakeModules/Warnings.cmake index 3a39553bb5..b7cd51a1d2 100644 --- a/CMakeModules/Warnings.cmake +++ b/CMakeModules/Warnings.cmake @@ -176,4 +176,11 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) set( WARN_FLAGS_CXX "${WARN_FLAGS_CXX} -Wno-psabi" ) message( STATUS "Disabling warning -Wpsabi" ) endif() + + # Append any additional warning flags so the end of the warning string + if( KICAD_ADDITIONAL_WARN_FLAGS ) + set( WARN_FLAGS_CXX "${WARN_FLAGS_CXX} ${KICAD_ADDITIONAL_WARN_FLAGS}" ) + message( STATUS "Adding additional warning flags: ${KICAD_ADDITIONAL_WARN_FLAGS}") + endif() + endif()