Форматирование кода

This commit is contained in:
Andrei Astafev 2020-04-18 19:40:13 +03:00
parent 8d2809a772
commit f0a7996d26
6 changed files with 20 additions and 22 deletions

View File

@ -24,8 +24,10 @@ endif()
if(CMAKE_BUILD_TYPE STREQUAL Profile) if(CMAKE_BUILD_TYPE STREQUAL Profile)
# Ключи компиляции для режима профилирования в зависимости от типа компилятора # Ключи компиляции для режима профилирования в зависимости от типа компилятора
if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC) if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -ggdb -pg -fno-omit-frame-pointer" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -ggdb -pg -fno-omit-frame-pointer" CACHE STRING ""
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb -pg -fno-omit-frame-pointer" CACHE STRING "" FORCE) FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb -pg -fno-omit-frame-pointer" CACHE STRING
"" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE) set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE) set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE)
set(CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE) set(CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE)

View File

@ -40,17 +40,16 @@ if(CMLIB_COMPACT_SOURCE_PACKAGE)
# Список масок для исключения из архива исходных текстов для более компактного архива # Список масок для исключения из архива исходных текстов для более компактного архива
set(CPACK_SOURCE_IGNORE_FILES set(CPACK_SOURCE_IGNORE_FILES
"${CPACK_SOURCE_IGNORE_FILES}" "${CPACK_SOURCE_IGNORE_FILES}"
"/\\\\.git/" "/\\\\.git/"
"/\\\\.gitlab-ci/" "/\\\\.gitlab-ci/"
"\\\\.clang-tidy$" "\\\\.clang-tidy$"
"\\\\.cmake-format$" "\\\\.cmake-format$"
"\\\\.gitignore$" "\\\\.gitignore$"
"\\\\.gitattributes$" "\\\\.gitattributes$"
"\\\\.gitmodules$" "\\\\.gitmodules$"
"\\\\.gitlab-ci.yml$") "\\\\.gitlab-ci.yml$")
endif() endif()
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_LIST_DIR}/CMLibCPackProject.cmake) set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_LIST_DIR}/CMLibCPackProject.cmake)
# Правила для сборки пакетов для Debian # Правила для сборки пакетов для Debian

View File

@ -22,9 +22,8 @@ function(add_clang_analyze_check target)
if(NOT TARGET clang-analyze-check) if(NOT TARGET clang-analyze-check)
add_custom_target(clang-analyze-check) add_custom_target(clang-analyze-check)
endif() endif()
add_custom_target( add_custom_target(clang-analyze-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
clang-analyze-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CLANG_CHECK_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
COMMAND ${CLANG_CHECK_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
add_dependencies(clang-analyze-check-${target} ${target}) add_dependencies(clang-analyze-check-${target} ${target})
add_dependencies(clang-analyze-check clang-analyze-check-${target}) add_dependencies(clang-analyze-check clang-analyze-check-${target})
else() else()

View File

@ -22,9 +22,8 @@ function(add_clang_tidy_check target)
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()
add_custom_target( add_custom_target(clang-tidy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
clang-tidy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CLANG_TIDY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
COMMAND ${CLANG_TIDY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
add_dependencies(clang-tidy-check-${target} ${target}) add_dependencies(clang-tidy-check-${target} ${target})
add_dependencies(clang-tidy-check clang-tidy-check-${target}) add_dependencies(clang-tidy-check clang-tidy-check-${target})
else() else()

View File

@ -2,16 +2,16 @@ function(add_clazy_check target)
find_program(CLAZY_EXE NAMES clazy-standalone) find_program(CLAZY_EXE NAMES clazy-standalone)
set(_sources ${ARGN}) set(_sources ${ARGN})
set(_clazy_checks set(_clazy_checks
"container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,isempty-vs-count,qt-keywords,unneeded-cast") "container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,isempty-vs-count,qt-keywords,unneeded-cast"
)
set(_args -checks=level2,${_clazy_checks} -extra-arg="-Wno-unknown-warning-option") set(_args -checks=level2,${_clazy_checks} -extra-arg="-Wno-unknown-warning-option")
if(CLAZY_EXE) if(CLAZY_EXE)
if(NOT TARGET clazy-check) if(NOT TARGET clazy-check)
add_custom_target(clazy-check) add_custom_target(clazy-check)
endif() endif()
add_custom_target( add_custom_target(clazy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
clazy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
add_dependencies(clazy-check-${target} ${target}) add_dependencies(clazy-check-${target} ${target})
add_dependencies(clazy-check clazy-check-${target}) add_dependencies(clazy-check clazy-check-${target})
else() else()

View File

@ -17,4 +17,3 @@ endif()
if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
message(FATAL_ERROR "Required variable CPACK_PACKAGE_DESCRIPTION_SUMMARY is not defined") message(FATAL_ERROR "Required variable CPACK_PACKAGE_DESCRIPTION_SUMMARY is not defined")
endif() endif()