Compare commits

..

No commits in common. "f0760fcd1176d42cc53dd1e57520144ef25d3ec8" and "f76b9c675848cf6f1f5a8e42a203a7d15b2c37ba" have entirely different histories.

4 changed files with 48 additions and 67 deletions

View File

@ -1,19 +1,16 @@
find_program(CLANG_CHECK_EXE function(add_clang_analyze_check)
list(GET ARGN 0 _target)
set(_sources ${ARGN})
list(REMOVE_AT _sources 0)
option(CLANG_ANALYZE_FIX "Perform fixes for Clang-Check" OFF)
find_program(CLANG_CHECK_EXE
NAMES clang-check-10 NAMES clang-check-10
clang-check-9 clang-check-9
clang-check-8 clang-check-8
clang-check-7 clang-check-7
clang-check-6.0 clang-check-6.0
clang-check) clang-check)
if(CLANG_CHECK_EXE)
option(CLANG_ANALYZE_FIX "Perform fixes for Clang-Check" OFF)
endif()
function(add_clang_analyze_check)
list(GET ARGN 0 _target)
set(_sources ${ARGN})
list(REMOVE_AT _sources 0)
if(CLANG_CHECK_EXE) if(CLANG_CHECK_EXE)
if(CLANG_CHECK_FIX) if(CLANG_CHECK_FIX)
list(APPEND _args "-fix") list(APPEND _args "-fix")

View File

@ -1,23 +1,20 @@
find_program(CLANG_TIDY_EXE function(add_clang_tidy_check)
list(GET ARGN 0 _target)
set(_sources ${ARGN})
list(REMOVE_AT _sources 0)
option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
find_program(CLANG_TIDY_EXE
NAMES clang-tidy-10 NAMES clang-tidy-10
clang-tidy-9 clang-tidy-9
clang-tidy-8 clang-tidy-8
clang-tidy-7 clang-tidy-7
clang-tidy-6.0 clang-tidy-6.0
clang-tidy) clang-tidy)
if(CLANG_TIDY_EXE) if(CLANG_TIDY_EXE)
option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
if(CLANG_TIDY_FIX) if(CLANG_TIDY_FIX)
list(APPEND _args "-fix") list(APPEND _args "-fix")
endif() endif()
endif()
function(add_clang_tidy_check)
list(GET ARGN 0 _target)
set(_sources ${ARGN})
list(REMOVE_AT _sources 0)
if(CLANG_TIDY_EXE)
if(NOT TARGET clang-tidy-check) if(NOT TARGET clang-tidy-check)
add_custom_target(clang-tidy-check) add_custom_target(clang-tidy-check)
endif() endif()

View File

@ -1,12 +1,9 @@
option(ENABLE_CODE_COVERAGE "Enable code coverage support" OFF)
find_program(LCOV_EXE NAMES lcov)
find_program(GENHTML_EXE NAMES genhtml)
function(add_code_coverage) function(add_code_coverage)
list(GET ARGN 0 _target) list(GET ARGN 0 _target)
if(ENABLE_CODE_COVERAGE) if(ENABLE_CODE_COVERAGE AND CMAKE_CXX_COMPILER_IS_GCC)
if(CMAKE_CXX_COMPILER_IS_GCC) find_program(LCOV_EXE NAMES lcov)
find_program(GENHTML_EXE NAMES genhtml)
target_compile_options(${_target} PUBLIC "--coverage") target_compile_options(${_target} PUBLIC "--coverage")
get_target_property(LF ${_target} LINK_FLAGS) get_target_property(LF ${_target} LINK_FLAGS)
string(APPEND LF " --coverage") string(APPEND LF " --coverage")
@ -38,5 +35,4 @@ function(add_code_coverage)
else() else()
message("Only GCC is supported for code coverage") message("Only GCC is supported for code coverage")
endif() endif()
endif()
endfunction() endfunction()

View File

@ -1,14 +1,5 @@
# based on https://github.com/bluescarni/yacma # based on https://github.com/bluescarni/yacma
find_program(LSB_RELEASE NAMES lsb_release)
if (LSB_RELEASE)
execute_process(COMMAND ${LSB_RELEASE} -d -s OUTPUT_VARIABLE LSB_DESC)
if ("${LSB_DESC}" STREQUAL "Astra Linux SE 1.5 (Smolensk)")
set(_CMAKE_TOOLCHAIN_PREFIX "x86_64-linux-gnu-")
set(_CMAKE_TOOLCHAIN_SUFFIX "-4.7")
endif()
endif()
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
macro(CHECK_ENABLE_CXX_FLAG flag) macro(CHECK_ENABLE_CXX_FLAG flag)