From 64499297191ef3c9cce2a07cdaf93a751f5b7eed Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sun, 19 Apr 2020 11:01:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=B0=20clazy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCodeAnalysisClazy.cmake | 64 +----------------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/CMLibCodeAnalysisClazy.cmake b/CMLibCodeAnalysisClazy.cmake index 16a03f8..d8bce01 100644 --- a/CMLibCodeAnalysisClazy.cmake +++ b/CMLibCodeAnalysisClazy.cmake @@ -18,7 +18,7 @@ function(add_clazy_check target) cmake_parse_arguments(_CLAZY "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(_sources ${ARGN}) + set(_sources ${_CLAZY_UNPARSED_ARGUMENTS}) if(NOT _CLAZY_CHECKS) set(_CLAZY_CHECKS "level2,container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,isempty-vs-count,qt-keywords,unneeded-cast") endif() @@ -38,68 +38,6 @@ function(add_clazy_check target) endif() add_dependencies(clazy-check-${target} ${target}) add_dependencies(clazy-check clazy-check-${target}) - -# option(CMLIB_CLAZY_FIX_QT_KEYWORDS "Fix Qt keywords" OFF) -# option(CMLIB_CLAZY_FIX_RANGE_LOOP_ADD_REF "Fix range loop add reference" OFF) -# option(CMLIB_CLAZY_FIX_RANGE_LOOP_ADD_QASCONST "Fix range loop add qAsConst" OFF) -# option(CMLIB_CLAZY_FIX_FUNCTION_ARGS_BY_REF "Fix function args by reference" OFF) -# option(CMLIB_CLAZY_FIX_OLD_STYLE_CONNECT "Fix old style connect" OFF) -# option(CMLIB_CLAZY_FIX_STRING_ALLOCATIONS "Fix string allocations" OFF) -# -# if(CMLIB_CLAZY_FIX_QT_KEYWORDS OR -# CMLIB_CLAZY_FIX_RANGE_LOOP_ADD_REF OR -# CMLIB_CLAZY_FIX_RANGE_LOOP_ADD_QASCONST OR -# CMLIB_CLAZY_FIX_FUNCTION_ARGS_BY_REF OR -# CMLIB_CLAZY_FIX_OLD_STYLE_CONNECT OR -# CMLIB_CLAZY_FIX_STRING_ALLOCATIONS) -# if(NOT TARGET clazy-fix) -# add_custom_target(clazy-fix) -# endif() -# if(CMLIB_CLAZY_FIX_QT_KEYWORDS) -# add_custom_target(clazy-fix-qt-keywords-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -# COMMAND ${CMAKE_COMMAND} -E env "CLAZY_FIXIT=fix-qt-keywords" -# ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}) -# add_dependencies(clazy-fix-qt-keywords-${target} ${target}) -# add_dependencies(clazy-fix clazy-fix-qt-keywords-${target}) -# endif() -# if(CMLIB_CLAZY_FIX_RANGE_LOOP_ADD_REF) -# add_custom_target(clazy-fix-range-loop-add-ref-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -# COMMAND ${CMAKE_COMMAND} -E env "CLAZY_FIXIT=fix-range-loop-add-ref" -# ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}) -# add_dependencies(clazy-fix-range-loop-add-ref-${target} ${target}) -# add_dependencies(clazy-fix clazy-fix-range-loop-add-ref-${target}) -# endif() -# if(CMLIB_CLAZY_FIX_RANGE_LOOP_ADD_QASCONST) -# add_custom_target(clazy-fix-range-loop-add-qasconst-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -# COMMAND ${CMAKE_COMMAND} -E env "CLAZY_FIXIT=fix-range-loop-add-qasconst" -# ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}) -# add_dependencies(clazy-fix-range-loop-add-qasconst-${target} ${target}) -# add_dependencies(clazy-fix clazy-fix-range-loop-add-qasconst-${target}) -# endif() -# if(CMLIB_CLAZY_FIX_FUNCTION_ARGS_BY_REF) -# add_custom_target(clazy-fix-function-args-by-ref-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -# COMMAND ${CMAKE_COMMAND} -E env "CLAZY_FIXIT=fix-function-args-by-ref" -# ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}) -# add_dependencies(clazy-fix-function-args-by-ref-${target} ${target}) -# add_dependencies(clazy-fix clazy-fix-function-args-by-ref-${target}) -# endif() -# if(CMLIB_CLAZY_FIX_OLD_STYLE_CONNECT) -# add_custom_target(clazy-fix-old-style-connect-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -# COMMAND ${CMAKE_COMMAND} -E env "CLAZY_FIXIT=fix-old-style-connect" -# ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}) -# add_dependencies(clazy-fix-old-style-connect-${target} ${target}) -# add_dependencies(clazy-fix clazy-fix-old-style-connect-${target}) -# endif() -# # "fix-qlatin1string-allocations", "qstring-allocations"); -# # "fix-fromLatin1_fromUtf8-allocations", "qstring-allocations"); -# # "fix-fromCharPtrAllocations", "qstring-allocations"); -# if(CMLIB_CLAZY_FIX_STRING_ALLOCATIONS) -# add_custom_target(clazy-fix-string-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -# COMMAND ${CMAKE_COMMAND} -E env "CLAZY_FIXIT=fix-qlatin1string-allocations" -# ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}) -# add_dependencies(clazy-fix-string-${target} ${target}) -# add_dependencies(clazy-fix clazy-fix-string-${target}) -# endif() endif() else() message(STATUS "CMLIB warning:")