Commit 914ff9ea authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'checkergccconfig' into 'master'

AtlasCompilerSettings: add ATLAS_GCC_CHECKERS_CONFIG cache variable

See merge request !971
parents 167b87b5 00f266df
Pipeline #4226084 passed with stage
in 114 minutes and 47 seconds
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
#
# This file collects settings fine-tuning all the compiler and linker options
# used in an ATLAS build in one place. It is included by default when using
......@@ -124,6 +124,8 @@ option( ATLAS_USE_GCC_CHECKERS
"Enable using the GCC checker plugins if they are available" ON )
set( ATLAS_GCC_CHECKERS ""
CACHE STRING "Checker(s) to activate during compilation" )
set( ATLAS_GCC_CHECKERS_CONFIG ""
CACHE STRING "Configuration file(s) for the GCC checker plugins" )
if( ATLAS_USE_GCC_CHECKERS AND ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" ) )
# First check if the library is even available:
find_library( _gccchecker "checker_gccplugins"
......@@ -131,13 +133,17 @@ if( ATLAS_USE_GCC_CHECKERS AND ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" ) )
mark_as_advanced( _gccchecker )
if( _gccchecker )
message( STATUS "Found checker_gccplugins library under: ${_gccchecker}" )
message( STATUS "Enabling checker_gccplugins with checker(s): "
"${ATLAS_GCC_CHECKERS}" )
_add_flag( CMAKE_CXX_FLAGS "-fplugin=${_gccchecker}" )
if( NOT "${ATLAS_GCC_CHECKERS}" STREQUAL "" )
message( STATUS "Enabling checker_gccplugins with checker(s): "
"${ATLAS_GCC_CHECKERS}" )
_add_flag( CMAKE_CXX_FLAGS
"-fplugin-arg-libchecker_gccplugins-checkers=${ATLAS_GCC_CHECKERS}" )
endif()
if( NOT "${ATLAS_GCC_CHECKERS_CONFIG}" STREQUAL "" )
_add_flag( CMAKE_CXX_FLAGS
"-fplugin-arg-libchecker_gccplugins-config=${ATLAS_GCC_CHECKERS_CONFIG}" )
endif()
else()
message( STATUS "checker_gccplugins library not found" )
endif()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment