Compare commits

...

10 Commits

Author SHA1 Message Date
d6d9bf7570 2.4.40 2024-04-12 13:00:06 +03:00
a42482170f 2.4.40 2024-04-12 12:58:23 +03:00
57269a7660 Совместимость с новыми версиям MyxCMake 2024-04-12 12:57:52 +03:00
62ad3b66c4 PVS 2024-04-12 12:57:09 +03:00
75cde136ba 2.4.34 2024-04-08 23:36:21 +03:00
2132fbf6b9 2.4.34 2024-04-08 23:35:56 +03:00
c054ac8e78 2.4.34 2024-04-08 23:35:29 +03:00
e735546b2d Цели для PVS-Studio 2024-04-08 23:35:00 +03:00
3b9e0373b5 PVS-Studio 2024-04-08 22:33:09 +03:00
358a03401b 2.4.32 2024-03-28 10:08:29 +03:00
12 changed files with 85 additions and 44 deletions

View File

@ -13,6 +13,7 @@ v:
sed -i "s/VERSION \".*\"/VERSION \"$V\"/" $(TOP_DIR)/MyxxCMake/MyxxCMakeConfigVersion.cmake sed -i "s/VERSION \".*\"/VERSION \"$V\"/" $(TOP_DIR)/MyxxCMake/MyxxCMakeConfigVersion.cmake
sed -i "s/VERSION .* LANG/VERSION $V LANG/" $(TOP_DIR)/debian/CMakeLists.txt sed -i "s/VERSION .* LANG/VERSION $V LANG/" $(TOP_DIR)/debian/CMakeLists.txt
sed -i "s/(.*)/($(V))/" $(TOP_DIR)/debian/changelog sed -i "s/(.*)/($(V))/" $(TOP_DIR)/debian/changelog
git commit -a -m "$(V)"
deb: deb:
rm -rf $(DEB_DIR) rm -rf $(DEB_DIR)
@ -27,11 +28,12 @@ pack:
tar acf $(BUILD_DIR)/myxx-cmake-local-$(V).tar.xz MyxxCMake tar acf $(BUILD_DIR)/myxx-cmake-local-$(V).tar.xz MyxxCMake
upload: upload:
# git tag -d $(V)
git tag $(V) git tag $(V)
tea r c --repo cmake/myxx -t $(V) --tag $(V) \ gitea-tea r c --repo cmake/myxx -t $(V) --tag $(V) \
-a $(BUILD_DIR)/myxx-cmake_$(V).dsc \ -a $(BUILD_DIR)/myxx-cmake_$(V).dsc \
-a $(BUILD_DIR)/myxx-cmake_$(V).tar.xz \ -a $(BUILD_DIR)/myxx-cmake_$(V).tar.xz \
-a $(BUILD_DIR)/myxx-cmake_$(V)_all.deb \ -a $(BUILD_DIR)/myxx-cmake_$(V)_all.deb \
-a $(BUILD_DIR)/myxx-cmake-local-$(V).tar.xz -a $(BUILD_DIR)/myxx-cmake-local-$(V).tar.xz
git tag -d $(V) git tag -d $(V)
git push git push --all

View File

@ -3,7 +3,7 @@ cmake_policy(SET CMP0057 NEW) # IN_LIST operator
get_filename_component(MYXX_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) get_filename_component(MYXX_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
if(NOT MyxCMake_DIR) if(NOT MYX_CMAKE_DIR)
message(FATAL_ERROR "MyxxCMake library required MyxCMake to work") message(FATAL_ERROR "MyxxCMake library required MyxCMake to work")
endif() endif()
@ -48,22 +48,40 @@ function(myxx)
get_target_property(__target_type ${__iter} TYPE) get_target_property(__target_type ${__iter} TYPE)
if((NOT ${__target_type} STREQUAL "UTILITY") AND if((NOT ${__target_type} STREQUAL "UTILITY") AND
(NOT ${__target_type} STREQUAL "INTERFACE_LIBRARY") AND
(NOT ${__iter} MATCHES ".*_shared$" ) AND (NOT ${__iter} MATCHES ".*_shared$" ) AND
(NOT ${__iter} MATCHES ".*_static$" ) (NOT ${__iter} MATCHES ".*_static$" )
) )
myxx_code_coverage(${__iter}) myxx_analyze_pvs_studio(${__iter})
myxx_analyze_clang_tidy(${__iter}) if(MYXX_CMAKE_CLANG_TIDY_FIX)
myxx_analyze_clang_tidy_naming(${__iter}) myxx_analyze_clang_tidy(${__iter} FIX)
myxx_analyze_clang_check(${__iter}) else()
myxx_analyze_clang_tidy(${__iter})
endif()
if(MYXX_CMAKE_CLANG_TIDY_NAMING_FIX)
myxx_analyze_clang_tidy_naming(${__iter} FIX)
else()
myxx_analyze_clang_tidy_naming(${__iter})
endif()
if(MYXX_CMAKE_CLANG_CHECK_FIX)
myxx_analyze_clang_check(${__iter} FIX)
else()
myxx_analyze_clang_check(${__iter})
endif()
if(MYXX_CMAKE_CLAZY_FIX) if(MYXX_CMAKE_CLAZY_FIX)
myxx_analyze_clazy(${__iter} FIX) myxx_analyze_clazy(${__iter} FIX)
else() else()
myxx_analyze_clazy(${__iter}) myxx_analyze_clazy(${__iter})
endif() endif()
myxx_analyze_pvs_studio(${__iter})
myxx_add_sanitizers(${__iter}) if(NOT ${__target_type} STREQUAL "INTERFACE_LIBRARY")
myxx_code_coverage(${__iter})
myxx_add_sanitizers(${__iter})
endif()
endif() endif()
endforeach() endforeach()
endfunction(myxx) endfunction(myxx)

View File

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

View File

@ -2,7 +2,7 @@ include_guard(GLOBAL)
if(NOT CLANG_APPLY_REPLACEMENTS_NAME) if(NOT CLANG_APPLY_REPLACEMENTS_NAME)
set(CLANG_APPLY_REPLACEMENTS_NAMES clang-apply-replacements) set(CLANG_APPLY_REPLACEMENTS_NAMES clang-apply-replacements)
foreach(V RANGE 9 18) foreach(V RANGE 9 19)
list(INSERT CLANG_APPLY_REPLACEMENTS_NAMES 0 "clang-apply-replacements-${V}") list(INSERT CLANG_APPLY_REPLACEMENTS_NAMES 0 "clang-apply-replacements-${V}")
endforeach() endforeach()
unset(V) unset(V)

View File

@ -2,7 +2,7 @@ include_guard(GLOBAL)
if(NOT CLANG_CHECK_NAME) if(NOT CLANG_CHECK_NAME)
set(CLANG_CHECK_NAMES clang-check) set(CLANG_CHECK_NAMES clang-check)
foreach(V RANGE 9 18) foreach(V RANGE 9 19)
list(INSERT CLANG_CHECK_NAMES 0 "clang-check-${V}") list(INSERT CLANG_CHECK_NAMES 0 "clang-check-${V}")
endforeach() endforeach()
unset(V) unset(V)

View File

@ -2,7 +2,7 @@ include_guard(GLOBAL)
if(NOT CLANG_TIDY_NAME) if(NOT CLANG_TIDY_NAME)
set(CLANG_TIDY_NAMES clang-tidy) set(CLANG_TIDY_NAMES clang-tidy)
foreach(V RANGE 9 18) foreach(V RANGE 9 19)
list(INSERT CLANG_TIDY_NAMES 0 "clang-tidy-${V}") list(INSERT CLANG_TIDY_NAMES 0 "clang-tidy-${V}")
endforeach() endforeach()
unset(V) unset(V)

View File

@ -39,12 +39,12 @@ function(myxx_analyze_pvs_studio TARGET_NAME)
set(ARG_MODE "GA:1,2,3;64:1,2;OP:1,2,3;CS:1,2;OWASP:1,2") set(ARG_MODE "GA:1,2,3;64:1,2;OP:1,2,3;CS:1,2;OWASP:1,2")
endif() endif()
get_target_property(__target_sources ${TARGET_NAME} SOURCES) get_target_property(target_src ${TARGET_NAME} SOURCES)
foreach(__iter ${__target_sources}) foreach(it ${target_src})
string(FIND ${__iter} ${CMAKE_BINARY_DIR} __pos) string(FIND ${it} ${CMAKE_BINARY_DIR} pos)
if(__pos EQUAL -1) if(pos EQUAL -1)
list(APPEND __filtered_sources ${__iter}) list(APPEND filtered_src ${it})
endif() endif()
endforeach() endforeach()
pvs_studio_add_target(TARGET ${TARGET_NAME}-analyze-pvs-studio pvs_studio_add_target(TARGET ${TARGET_NAME}-analyze-pvs-studio
@ -56,16 +56,16 @@ function(myxx_analyze_pvs_studio TARGET_NAME)
ARGS --exclude-path ${CMAKE_CURRENT_BINARY_DIR} ${ARG_ARGS} ARGS --exclude-path ${CMAKE_CURRENT_BINARY_DIR} ${ARG_ARGS}
MODE ${ARG_MODE}) MODE ${ARG_MODE})
get_target_property(__target_type ${TARGET_NAME} TYPE) get_target_property(target_type ${TARGET_NAME} TYPE)
if(${__target_type} STREQUAL INTERFACE_LIBRARY) if(${target_type} STREQUAL INTERFACE_LIBRARY)
set(__target_type INTERFACE) set(target_type INTERFACE)
else() else()
set(__target_type PRIVATE) set(target_type PRIVATE)
endif() endif()
if(MSVC) if(MSVC)
target_compile_options(${TARGET_NAME} BEFORE ${__target_type} /FI ${ARG_HEADER}) target_compile_options(${TARGET_NAME} BEFORE ${target_type} /FI ${ARG_HEADER})
else() # GCC/Clang else() # GCC/Clang
target_compile_options(${TARGET_NAME} BEFORE ${__target_type} -include ${ARG_HEADER}) target_compile_options(${TARGET_NAME} BEFORE ${target_type} -include ${ARG_HEADER})
endif() endif()
add_dependencies(${TARGET_NAME}-analyze-pvs-studio ${TARGET_NAME}) add_dependencies(${TARGET_NAME}-analyze-pvs-studio ${TARGET_NAME})

View File

@ -3,8 +3,7 @@
# 2020-2022 (c) PVS-Studio LLC # 2020-2022 (c) PVS-Studio LLC
# Version 12 # Version 12
cmake_minimum_required(VERSION 3.0.0) cmake_minimum_required(VERSION 3.6)
cmake_policy(SET CMP0051 NEW)
cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0054 NEW)
if (PVS_STUDIO_AS_SCRIPT) if (PVS_STUDIO_AS_SCRIPT)
@ -60,7 +59,7 @@ function (pvs_studio_log TEXT)
endfunction() endfunction()
function (pvs_studio_relative_path VAR ROOT FILEPATH) function (pvs_studio_relative_path VAR ROOT FILEPATH)
if (WIN32) if (CMAKE_HOST_WIN32)
STRING(REGEX REPLACE "\\\\" "/" ROOT ${ROOT}) STRING(REGEX REPLACE "\\\\" "/" ROOT ${ROOT})
STRING(REGEX REPLACE "\\\\" "/" FILEPATH ${FILEPATH}) STRING(REGEX REPLACE "\\\\" "/" FILEPATH ${FILEPATH})
endif() endif()
@ -105,6 +104,8 @@ macro (pvs_studio_append_standard_flag FLAGS STANDARD)
if ("${STANDARD}" MATCHES "^(99|11|14|17|20)$") if ("${STANDARD}" MATCHES "^(99|11|14|17|20)$")
if ("${PVS_STUDIO_PREPROCESSOR}" MATCHES "gcc|clang") if ("${PVS_STUDIO_PREPROCESSOR}" MATCHES "gcc|clang")
list(APPEND "${FLAGS}" "-std=c++${STANDARD}") list(APPEND "${FLAGS}" "-std=c++${STANDARD}")
elseif("${PVS_STUDIO_PREPROCESSOR}" MATCHES "visualcpp")
list(APPEND "${FLAGS}" "/std:c++${STANDARD}")
endif() endif()
endif() endif()
endmacro() endmacro()
@ -184,7 +185,7 @@ function (pvs_studio_analyze_file SOURCE SOURCE_DIR BINARY_DIR)
pvs_studio_relative_path(SOURCE_RELATIVE "${SOURCE_DIR}" "${SOURCE}") pvs_studio_relative_path(SOURCE_RELATIVE "${SOURCE_DIR}" "${SOURCE}")
pvs_studio_join_path(SOURCE "${SOURCE_DIR}" "${SOURCE}") pvs_studio_join_path(SOURCE "${SOURCE_DIR}" "${SOURCE}")
set(LOG "${BINARY_DIR}/PVS-Studio/${SOURCE_RELATIVE}.plog") set(LOG "${BINARY_DIR}/PVS-Studio/${TARGET}/${SOURCE_RELATIVE}.log")
get_filename_component(LOG "${LOG}" REALPATH) get_filename_component(LOG "${LOG}" REALPATH)
get_filename_component(PARENT_DIR "${LOG}" DIRECTORY) get_filename_component(PARENT_DIR "${LOG}" DIRECTORY)
@ -343,7 +344,7 @@ function (pvs_studio_add_target)
set(PATHS) set(PATHS)
if (WIN32) if (CMAKE_HOST_WIN32)
# The registry value is only read when you do some cache operation on it. # The registry value is only read when you do some cache operation on it.
# https://stackoverflow.com/questions/1762201/reading-registry-values-with-cmake # https://stackoverflow.com/questions/1762201/reading-registry-values-with-cmake
GET_FILENAME_COMPONENT(ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\ProgramVerificationSystems\\PVS-Studio;installDir]" ABSOLUTE CACHE) GET_FILENAME_COMPONENT(ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\ProgramVerificationSystems\\PVS-Studio;installDir]" ABSOLUTE CACHE)
@ -521,18 +522,38 @@ function (pvs_studio_add_target)
pvs_studio_relative_path(LOG_RELATIVE "${CMAKE_BINARY_DIR}" "${PVS_STUDIO_LOG}") pvs_studio_relative_path(LOG_RELATIVE "${CMAKE_BINARY_DIR}" "${PVS_STUDIO_LOG}")
if (PVS_STUDIO_PLOGS OR PVS_STUDIO_COMPILE_COMMANDS) if (PVS_STUDIO_PLOGS OR PVS_STUDIO_COMPILE_COMMANDS)
if (WIN32) if (CMAKE_HOST_WIN32)
string(REPLACE / \\ PVS_STUDIO_PLOGS "${PVS_STUDIO_PLOGS}") string(REPLACE / \\ PVS_STUDIO_PLOGS "${PVS_STUDIO_PLOGS}")
endif() if (CMAKE_GENERATOR MATCHES "NMake")
if (WIN32) set(COMMAND_TYPE_FILE "${CMAKE_BINARY_DIR}/PVSConcatAllLogs.cmd")
set(COMMANDS COMMAND type ${PVS_STUDIO_PLOGS} ${PVS_STUDIO_PLOGS_LOGS} > "${PVS_STUDIO_LOG}" 2>nul || cd .)
# The number of files that will be merged in one call to the type command
set(STEP_SIZE 30)
set(BEGIN 0)
list(APPEND PVS_STUDIO_PLOGS ${PVS_STUDIO_PLOGS_LOGS})
list(LENGTH PVS_STUDIO_PLOGS END)
# Creating a bat file to call the 'type' command
file(WRITE ${COMMAND_TYPE_FILE} "@echo off\nbreak > ${PVS_STUDIO_LOG}\n")
while(BEGIN LESS END)
list(SUBLIST PVS_STUDIO_PLOGS ${BEGIN} ${STEP_SIZE} NEW_LIST)
file(APPEND ${COMMAND_TYPE_FILE} "type ${NEW_LIST} >> ${PVS_STUDIO_LOG} 2>nul || cd .\n")
math(EXPR BEGIN "${BEGIN} + ${STEP_SIZE}")
endwhile()
list(APPEND COMMANDS COMMAND call ${COMMAND_TYPE_FILE})
else()
set(COMMANDS COMMAND type ${PVS_STUDIO_PLOGS} ${PVS_STUDIO_PLOGS_LOGS} > "${PVS_STUDIO_LOG}" 2>nul || cd .)
endif()
else() else()
set(COMMANDS COMMAND cat ${PVS_STUDIO_PLOGS} ${PVS_STUDIO_PLOGS_LOGS} > "${PVS_STUDIO_LOG}" 2>/dev/null || true) set(COMMANDS COMMAND cat ${PVS_STUDIO_PLOGS} ${PVS_STUDIO_PLOGS_LOGS} > "${PVS_STUDIO_LOG}" 2>/dev/null || true)
endif() endif()
set(COMMENT "Generating ${LOG_RELATIVE}") set(COMMENT "Generating ${LOG_RELATIVE}")
if (NOT "${PVS_STUDIO_FORMAT}" STREQUAL "" OR PVS_STUDIO_OUTPUT) if (NOT "${PVS_STUDIO_FORMAT}" STREQUAL "" OR PVS_STUDIO_OUTPUT)
if ("${PVS_STUDIO_FORMAT}" STREQUAL "") if ("${PVS_STUDIO_FORMAT}" STREQUAL "")
set(PVS_STUDIO_FORMAT "errorfile") set(PVS_STUDIO_FORMAT "errorfile")
endif() endif()
if (PVS_STUDIO_HIDE_HELP) if (PVS_STUDIO_HIDE_HELP)
set(PVS_STUDIO_CONVERTER_ARGS ${PVS_STUDIO_CONVERTER_ARGS} --noHelpMessages) set(PVS_STUDIO_CONVERTER_ARGS ${PVS_STUDIO_CONVERTER_ARGS} --noHelpMessages)
@ -553,7 +574,7 @@ function (pvs_studio_add_target)
set(COMMENT "Generating ${LOG_RELATIVE}: no sources found") set(COMMENT "Generating ${LOG_RELATIVE}: no sources found")
endif() endif()
if (WIN32) if (CMAKE_HOST_WIN32)
string(REPLACE / \\ PVS_STUDIO_LOG "${PVS_STUDIO_LOG}") string(REPLACE / \\ PVS_STUDIO_LOG "${PVS_STUDIO_LOG}")
endif() endif()

View File

@ -2,9 +2,9 @@
## Установка ## Установка
Скачать [пакет](../../../releases/download/2.1.92/myxx-cmake_2.1.92_all.deb) Скачать [пакет](../../../releases/download/2.4.40/myxx-cmake_2.4.40_all.deb)
для Debian и установить его, выполнив команду `sudo dpkg -i myxx-cmake_2.1.92_all.deb`, для Debian и установить его, выполнив команду `sudo dpkg -i myxx-cmake_2.4.40_all.deb`,
или [архив](../../../releases/download/2.1.92/myxx-cmake-local-2.1.92.tar.xz) или [архив](../../../releases/download/2.4.40/myxx-cmake-local-2.4.40.tar.xz)
и распаковать его в каталог `$HOME/.local/share/cmake`. и распаковать его в каталог `$HOME/.local/share/cmake`.
## Использование ## Использование

View File

@ -1 +1 @@
2.1.92 2.4.40

View File

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

2
debian/changelog vendored
View File

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