This commit is contained in:
Andrei Astafev 2022-10-07 08:03:56 +03:00
parent e0e25bf0c4
commit 8c57311bb0
8 changed files with 98 additions and 6 deletions

View File

@ -20,6 +20,7 @@ if(IS_DIRECTORY "${MYXX_CMAKE_SANITIZERS_DIR}")
endif()
find_package(Sanitizers REQUIRED)
include(${MYXX_CMAKE_LIB_DIR}/WarningFlags.cmake)
include(${MYXX_CMAKE_LIB_DIR}/Coverage.cmake)
include(${MYXX_CMAKE_LIB_DIR}/AnalyzeApplyReplacements.cmake)
include(${MYXX_CMAKE_LIB_DIR}/AnalyzeClangTidy.cmake)
@ -40,7 +41,10 @@ function(myxx)
get_property(targets DIRECTORY ${CMAKE_BINARY_DIR} PROPERTY BUILDSYSTEM_TARGETS)
foreach(iter ${targets})
get_target_property(target_type ${iter} TYPE)
if(NOT ${target_type} STREQUAL "UTILITY")
if((NOT ${target_type} STREQUAL "UTILITY") AND
(NOT ${iter} MATCHES ".*_shared$" ) AND
(NOT ${iter} MATCHES ".*_static$" )
)
myxx_code_coverage(${iter})
myxx_analyze_clang_tidy(${iter})
myxx_analyze_clang_check(${iter})

View File

@ -1,4 +1,4 @@
set(MYXX_CMAKE_PACKAGE_VERSION "2.0.4")
set(MYXX_CMAKE_PACKAGE_VERSION "2.0.5")
if(MYXX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()

View File

@ -35,7 +35,7 @@ function(myxx_analyze_pvs_studio target)
endif()
pvs_studio_add_target(TARGET ${target}-analyze-pvs-studio
ANALYZE ${target}
ANALYZE ${target} RECURSIVE
HIDE_HELP
OUTPUT
FORMAT errorfile

View File

@ -0,0 +1,87 @@
include_guard(GLOBAL)
option(MYX_CMAKE_WARNINGS_NORMAL "Normal level" ON)
cmake_dependent_option(MYX_CMAKE_WARNINGS_VERBOSE "Verbose level" OFF "MYX_CMAKE_WARNINGS_NORMAL" OFF)
if(MYX_CMAKE_WARNINGS_NORMAL)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
check_enable_cxx_compiler_flag(-Wshadow)
check_enable_cxx_compiler_flag(-Wtautological-overlap-compare)
check_enable_cxx_compiler_flag(-Wtautological-compare)
check_enable_cxx_compiler_flag(-Wtautological-bitwise-compare)
check_enable_cxx_compiler_flag(-Wbitwise-conditional-parentheses)
check_enable_cxx_compiler_flag(-Wrange-loop-analysis)
check_enable_cxx_compiler_flag(-Wmisleading-indentation)
check_enable_cxx_compiler_flag(-Wc99-designator)
check_enable_cxx_compiler_flag(-Wreorder-init-list)
check_enable_cxx_compiler_flag(-Wsizeof-pointer-div)
check_enable_cxx_compiler_flag(-Wsizeof-array-div)
check_enable_cxx_compiler_flag(-Wxor-used-as-pow)
check_enable_cxx_compiler_flag(-Wfinal-dtor-non-final-class)
endif()
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
check_enable_cxx_compiler_flag(-Wall)
check_enable_cxx_compiler_flag(-Wextra)
check_enable_cxx_compiler_flag(-Wnon-virtual-dtor)
check_enable_cxx_compiler_flag(-Wlogical-op)
check_enable_cxx_compiler_flag(-Wconversion)
check_enable_cxx_compiler_flag(-Wdeprecated)
check_enable_cxx_compiler_flag(-ftemplate-depth=1024)
check_enable_cxx_compiler_flag(-Wold-style-cast)
check_enable_cxx_compiler_flag(-Wdisabled-optimization)
check_enable_cxx_compiler_flag(-ftemplate-backtrace-limit=0)
check_enable_cxx_compiler_flag(-fstack-protector-all)
check_enable_cxx_compiler_flag(-Wodr)
check_enable_cxx_compiler_flag(-Wsuggest-final-types)
check_enable_cxx_compiler_flag(-Wsuggest-final-methods)
check_enable_cxx_compiler_flag(-Wsuggest-override)
check_enable_cxx_compiler_flag(-fdiagnostics-show-template-tree)
if(NOT MYX_CMAKE_WARNINGS_VERBOSE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.999")
check_enable_cxx_compiler_flag(-Wno-attributes)
endif()
check_enable_cxx_compiler_flag(-Wno-maybe-uninitialized)
endif()
endif()
endif()
endif()
if(MYX_CMAKE_WARNINGS_VERBOSE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
check_enable_cxx_compiler_flag(-Wpointer-to-int-cast)
check_enable_cxx_compiler_flag(-Wuninitialized-const-reference)
check_enable_cxx_compiler_flag(-Wunused-but-set-parameter)
check_enable_cxx_compiler_flag(-Wunused-but-set-variable)
check_enable_cxx_compiler_flag(-Wnull-pointer-subtraction)
check_enable_cxx_compiler_flag(-Wno-reserved-identifier)
endif()
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
check_enable_cxx_compiler_flag(-Wshadow)
check_enable_cxx_compiler_flag(-Wpedantic)
check_enable_cxx_compiler_flag(-Wnoexcept)
check_enable_cxx_compiler_flag(-Wzero-as-null-pointer-constant)
# From GCC 6.
check_enable_cxx_compiler_flag(-Wshift-negative-value)
check_enable_cxx_compiler_flag(-Wshift-overflow=2)
check_enable_cxx_compiler_flag(-Wduplicated-cond)
check_enable_cxx_compiler_flag(-Wnull-dereference)
# From GCC 7.
check_enable_cxx_compiler_flag(-Wduplicated-branches)
check_enable_cxx_compiler_flag(-Wrestrict)
check_enable_cxx_compiler_flag(-Waligned-new)
# From GCC 8.
check_enable_cxx_compiler_flag(-Wcast-align=strict)
# From GCC 10.
check_enable_cxx_compiler_flag(-Wmismatched-tags)
check_enable_cxx_compiler_flag(-Wredundant-tags)
# From GCC 12.
check_enable_cxx_compiler_flag(-Warray-compare)
check_enable_cxx_compiler_flag(-Wmissing-requires)
endif()
endif()

View File

@ -4,6 +4,7 @@
# Version 12
cmake_minimum_required(VERSION 3.0.0)
cmake_policy(SET CMP0051 NEW)
cmake_policy(SET CMP0054 NEW)
if (PVS_STUDIO_AS_SCRIPT)

View File

@ -1 +1 @@
2.0.4
2.0.5

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
project(myxx-cmake VERSION 2.0.4 LANGUAGES)
project(myxx-cmake VERSION 2.0.5 LANGUAGES)
include(GNUInstallDirs)
file(WRITE ${CMAKE_SOURCE_DIR}/MyxxCMake/MyxxCMakeConfigVersion.cmake

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
myxx-cmake (2.0.4) unstable; urgency=medium
myxx-cmake (2.0.5) unstable; urgency=medium
* New version.