Merge topic 'patch-FindSDL-version' faca50bd3f FindSDL*: Add <PackageName>_VERSION Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !11004
diff --git a/.gitlab/ci/env_fedora42_clazy.sh b/.gitlab/ci/env_fedora42_clazy.sh index 8df878e..007c52d 100644 --- a/.gitlab/ci/env_fedora42_clazy.sh +++ b/.gitlab/ci/env_fedora42_clazy.sh
@@ -10,7 +10,6 @@ ,no-copyable-polymorphic\ ,no-ctor-missing-parent-argument\ ,no-function-args-by-ref\ -,no-function-args-by-value\ ,no-missing-qobject-macro\ ,no-non-pod-global-static\ ,no-old-style-connect\
diff --git a/.gitlab/ci/iar-env.sh b/.gitlab/ci/iar-env.sh index 9ec7494..39a5580 100644 --- a/.gitlab/ci/iar-env.sh +++ b/.gitlab/ci/iar-env.sh
@@ -1,10 +1,10 @@ files=' -bxarm-9.60.4.deb +bxarm-9.70.1.deb bxavr-8.10.2.deb bxrh850-3.10.2.deb -bxriscv-3.30.1.deb -bxrl78-5.10.3.deb -bxrx-5.10.1.deb +bxriscv-3.40.1.deb +bxrl78-5.20.1.deb +bxrx-5.20.1.deb ' for f in $files; do # This URL is only visible inside of Kitware's network. @@ -12,12 +12,12 @@ done echo ' -cd92a136bc9bbb1e713121cb407131b54250d2ae30809df3cd752c6383e1878f bxarm-9.60.4.deb +3b16748e560ab8fa3ffe6d6807186ac706134c78bc9db911112ab3ee67c7b997 bxarm-9.70.1.deb 4a1065291952a23a8bfbbaa4eb36ca49b0af8653b8faab34ce955d9d48d64506 bxavr-8.10.2.deb b14085a0f21750c58168125d3cece2e3fcbd4c6495c652b5e65b6637bac0ac31 bxrh850-3.10.2.deb -517e18dffdd4345f97c480b5128c7feea25ec1c3f06e62d8e2e6808c401d514a bxriscv-3.30.1.deb -3deca7f6afd5f47684464ad748334ab0690097a109d9c680603450074fc32ccf bxrl78-5.10.3.deb -260e592c48cbaf902b13bdb2feeeba83068978131fcb5c027dab17e715dec7e7 bxrx-5.10.1.deb +2e7de58a3aad43ef4199b811edd4dae9c4bff633376393f12fcb77ca27aba831 bxriscv-3.40.1.deb +6a2b6163dd971635715f49cb072c853e5de55d2b0089f319a6a9f6db540af4bd bxrl78-5.20.1.deb +059667a53b6683b1b09b7842d71e784c04bc2376734421c3a628acdbc6bef9e3 bxrx-5.20.1.deb ' > bxdebs.sha256sum sha256sum --check bxdebs.sha256sum
diff --git a/.gitlab/ci/iar.ps1 b/.gitlab/ci/iar.ps1 index 2034fa2..4c1093d 100644 --- a/.gitlab/ci/iar.ps1 +++ b/.gitlab/ci/iar.ps1
@@ -7,12 +7,12 @@ $iar_dir = New-Item -Force -ItemType Directory -Path "$outdir\iar" $files = @{ - "bxarm-9.60.4.11196-1.zip" = "0DE5F610D0FA3A6513C856BC2403A84D5277F1F6D0D65A6022D1FD745BC4AF6A" + "bxarm-9.70.1.13552-1.zip" = "866792FA6881C28610558E87EE02A45752CC06E7550FB57682720CDC300DA0B7" "BXAVR-8102-1.zip" = "862EFD23531854506070D5647F9B32197B80E5A727304BFBD8E386A3DAADF093" "BXRH850-3102-1.zip" = "8D1D009A0D138C7CA8431316123CB85CE1B41319A68B997F90D2E338CD469C7F" - "BXRISCV-3301-1.zip" = "59FF23F7B98EE72567A23942DE799AF137791A19BFEC102B2A59821FABBCA55A" - "BXRL78-5103-1.zip" = "00398E7197735A7B0A4310BF906808E883548814475C12D6EF2C03388F77E6A7" - "BXRX-5101-1.zip" = "D63E95ECD454B4998946C2D9DC1CB6CEF69CE15524C11A123263E6A8E88D9899" + "BXRISCV-3401-1.zip" = "633F9BF64429923B0C478FB8ED0C47B3A67BC9B23DD9A2851DE66AC70DA64E06" + "bxrl78-5.20.1.2826-1.zip" = "71E981EC18C5BC031A356D89C4D6579DF0B0EF9EB34AB3B46A48DA3F3737C2D4" + "bxrx-5.20.1.6541-1.zip" = "C000B333618A253482DCCB8F06CB902F6D9D0B7D554B863175D316004FBFFC82" } foreach ($f in $files.GetEnumerator()) {
diff --git a/.gitlab/ci/repackage/iar.ps1 b/.gitlab/ci/repackage/iar.ps1 index 5a8c1e5..eb140cd 100644 --- a/.gitlab/ci/repackage/iar.ps1 +++ b/.gitlab/ci/repackage/iar.ps1
@@ -23,12 +23,26 @@ "arm/config/flashloader" "arm/drivers" "arm/src" + "riscv/config/debugger" + "riscv/config/flashloader" + "riscv/drivers" + "riscv/src" + "rl78/config/debugger" + "rl78/config/flashloader" + "rl78/drivers" + "rl78/src" + "rx/config/debugger" + "rx/config/flashloader" + "rx/drivers" + "rx/src" ) Write-Host "Installing to: $package_dir" Start-Process -Wait -FilePath "$installer_file" -ArgumentList "/hide_usd /autoinstall/$package_dir" foreach ($p in $exclude) { - Remove-Item "$package_dir/$p" -Recurse -Force + if (Test-Path "$package_dir/$p") { + Remove-Item "$package_dir/$p" -Recurse -Force + } } @"
diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst index 9695ddf..a1dc5f9 100644 --- a/Help/command/find_file.rst +++ b/Help/command/find_file.rst
@@ -4,7 +4,7 @@ .. |FIND_XXX| replace:: find_file .. |NAMES| replace:: NAMES name1 [name2 ...] .. |SEARCH_XXX| replace:: full path to a file -.. |SEARCH_XXX_DESC| replace:: full path to named file +.. |SEARCH_XXX_DESC| replace:: full path to a named file .. |prefix_XXX_SUBDIR| replace:: ``<prefix>/include`` .. |entry_XXX_SUBDIR| replace:: ``<entry>/include``
diff --git a/Help/command/include/FIND_XXX.rst b/Help/command/include/FIND_XXX.rst index 9d063ad..194b6f8 100644 --- a/Help/command/include/FIND_XXX.rst +++ b/Help/command/include/FIND_XXX.rst
@@ -32,11 +32,27 @@ ) This command is used to find a |SEARCH_XXX_DESC|. -A cache entry, or a normal variable if ``NO_CACHE`` is specified, -named by ``<VAR>`` is created to store the result of this command. -If the |SEARCH_XXX| is found the result is stored in the variable -and the search will not be repeated unless the variable is cleared. -If nothing is found, the result will be ``<VAR>-NOTFOUND``. + +Prior to searching, |FIND_XXX| checks if variable ``<VAR>`` is defined. If +the variable is not defined, the search will be performed. If the variable is +defined and its value is ``NOTFOUND``, or ends in ``-NOTFOUND``, the search +will be performed. If the variable contains any other value the search is not +performed. + + .. note:: + ``VAR`` is considered defined if it is available in the current scope. See + the :ref:`cmake-language(7) variables <CMake Language Variables>` + documentation for details on scopes, and the interaction of normal + variables and cache entries. + +The results of the search will be stored in a cache entry named ``<VAR>``. +Future calls to |FIND_XXX| will inspect this cache entry when specifying the +same ``<VAR>``. This optimization ensures successful searches will not be +repeated unless the cache entry is :command:`unset`. + +If the |SEARCH_XXX| is found the recorded value in cache entry ``<VAR>`` will +be the result of the search. If nothing is found, the recorded value will be +``<VAR>-NOTFOUND``. Options include: @@ -103,8 +119,9 @@ .. note:: - If the variable is already set before the call (as a normal or cache - variable) then the search will not occur. + |FIND_XXX| will still check for ``<VAR>`` as usual, checking first for a + variable, and then a cache entry. If either indicate a previous successful + search, the search will not be performed. .. warning::
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake index 585b846..e3a751b 100644 --- a/Modules/FindGIF.cmake +++ b/Modules/FindGIF.cmake
@@ -5,7 +5,11 @@ FindGIF ------- -Finds the Graphics Interchange Format (GIF) library (``giflib``). +Finds the Graphics Interchange Format (GIF) library (``giflib``): + +.. code-block:: cmake + + find_package(GIF [<version>] [...]) Imported Targets ^^^^^^^^^^^^^^^^ @@ -21,19 +25,22 @@ Result Variables ^^^^^^^^^^^^^^^^ -This module sets the following variables: +This module defines the following variables: ``GIF_FOUND`` - Boolean indicating whether the GIF library was found. -``GIF_INCLUDE_DIRS`` - Include directories needed to use the GIF library. -``GIF_LIBRARIES`` - Libraries needed to link to the GIF library. + Boolean indicating whether (the requested version of) GIF library was found. + ``GIF_VERSION`` Version string of the GIF library found (for example, ``5.1.4``). For GIF library versions prior to 4.1.6, version string will be set only to ``3`` or ``4`` as these versions did not provide version information in their headers. +``GIF_INCLUDE_DIRS`` + Include directories needed to use the GIF library. + +``GIF_LIBRARIES`` + Libraries needed to link to the GIF library. + Cache Variables ^^^^^^^^^^^^^^^ @@ -41,6 +48,7 @@ ``GIF_INCLUDE_DIR`` Directory containing the ``gif_lib.h`` and other GIF library headers. + ``GIF_LIBRARY`` Path to the GIF library.
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake index 9d43f58..b44612f 100644 --- a/Modules/FindJPEG.cmake +++ b/Modules/FindJPEG.cmake
@@ -5,7 +5,11 @@ FindJPEG -------- -Finds the Joint Photographic Experts Group (JPEG) library (``libjpeg``). +Finds the Joint Photographic Experts Group (JPEG) library (``libjpeg``): + +.. code-block:: cmake + + find_package(JPEG [<version>] [...]) .. versionchanged:: 3.12 Debug and Release JPEG library variants are now found separately. @@ -24,10 +28,15 @@ Result Variables ^^^^^^^^^^^^^^^^ -This module sets the following variables: +This module defines the following variables: ``JPEG_FOUND`` - Boolean indicating whether the JPEG is found. + Boolean indicating whether (the requested version of) JPEG library is found. + +``JPEG_VERSION`` + .. versionadded:: 3.12 + + The version of JPEG library found. ``JPEG_INCLUDE_DIRS`` Include directories containing headers needed to use JPEG. @@ -35,18 +44,13 @@ ``JPEG_LIBRARIES`` Libraries needed to link to JPEG. -``JPEG_VERSION`` - .. versionadded:: 3.12 - - The version of the JPEG library found. - Cache Variables ^^^^^^^^^^^^^^^ The following cache variables may also be set: ``JPEG_INCLUDE_DIR`` - Directory containing the ``jpeglib.h`` and related header files. + Directory containing the ``<jpeglib.h>`` and related header files. ``JPEG_LIBRARY_RELEASE`` .. versionadded:: 3.12 @@ -58,13 +62,13 @@ Path to the debug variant of the JPEG library. -Obsolete Variables -^^^^^^^^^^^^^^^^^^ +Deprecated Variables +^^^^^^^^^^^^^^^^^^^^ -The following legacy variables are provided for backward compatibility: +The following variables are provided for backward compatibility: ``JPEG_LIBRARY`` - .. versionchanged:: 3.12 + .. deprecated:: 3.12 This variable has been superseded by the ``JPEG_LIBRARY_RELEASE`` and ``JPEG_LIBRARY_DEBUG`` variables.
diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake index 914b84a..b7fe4b1 100644 --- a/Modules/FindSQLite3.cmake +++ b/Modules/FindSQLite3.cmake
@@ -7,9 +7,14 @@ .. versionadded:: 3.14 -Finds the SQLite 3 library. SQLite is a small, fast, self-contained, -high-reliability, and full-featured SQL database engine written in C, intended -for embedding in applications. +Finds the SQLite 3 library: + +.. code-block:: cmake + + find_package(SQLite3 [<version>] [...]) + +SQLite is a small, fast, self-contained, high-reliability, and full-featured +SQL database engine written in C, intended for embedding in applications. Imported Targets ^^^^^^^^^^^^^^^^ @@ -23,17 +28,21 @@ Result Variables ^^^^^^^^^^^^^^^^ -This module sets the following variables: +This module defines the following variables: + +``SQLite3_FOUND`` + Boolean indicating whether (the requested version of) SQLite library is + found. + +``SQLite3_VERSION`` + The version of SQLite library found. ``SQLite3_INCLUDE_DIRS`` - Include directories containing the ``sqlite3.h`` and related headers needed - to use SQLite. + Include directories containing the ``<sqlite3.h>`` and related headers + needed to use SQLite. + ``SQLite3_LIBRARIES`` Libraries needed to link against to use SQLite. -``SQLite3_VERSION`` - Version of the SQLite library found. -``SQLite3_FOUND`` - Boolean indicating whether the SQLite library is found. Examples ^^^^^^^^
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index fd7d41d..cfb1acd 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake
@@ -5,7 +5,11 @@ FindZLIB -------- -Finds the native zlib data compression library. +Finds the native zlib data compression library: + +.. code-block:: cmake + + find_package(ZLIB [<version>] [...]) Imported Targets ^^^^^^^^^^^^^^^^ @@ -23,6 +27,14 @@ This module defines the following variables: +``ZLIB_FOUND`` + Boolean indicating whether (the requested version of) zlib is found. + +``ZLIB_VERSION`` + .. versionadded:: 3.26 + + The version of zlib found. + ``ZLIB_INCLUDE_DIRS`` Include directories containing ``zlib.h`` and other headers needed to use zlib. @@ -33,58 +45,6 @@ .. versionchanged:: 3.4 Debug and Release library variants can be now found separately. -``ZLIB_FOUND`` - True if zlib is found. - -``ZLIB_VERSION`` - .. versionadded:: 3.26 - - The version of zlib found. - -Legacy Variables -^^^^^^^^^^^^^^^^ - -The following variables are provided for backward compatibility: - -``ZLIB_VERSION_MAJOR`` - The major version of zlib. - - .. versionchanged:: 3.26 - Superseded by ``ZLIB_VERSION``. - -``ZLIB_VERSION_MINOR`` - The minor version of zlib. - - .. versionchanged:: 3.26 - Superseded by ``ZLIB_VERSION``. - -``ZLIB_VERSION_PATCH`` - The patch version of zlib. - - .. versionchanged:: 3.26 - Superseded by ``ZLIB_VERSION``. - -``ZLIB_VERSION_TWEAK`` - The tweak version of zlib. - - .. versionchanged:: 3.26 - Superseded by ``ZLIB_VERSION``. - -``ZLIB_VERSION_STRING`` - The version of zlib found (x.y.z). - - .. versionchanged:: 3.26 - Superseded by ``ZLIB_VERSION``. - -``ZLIB_MAJOR_VERSION`` - The major version of zlib. Superseded by ``ZLIB_VERSION_MAJOR``. - -``ZLIB_MINOR_VERSION`` - The minor version of zlib. Superseded by ``ZLIB_VERSION_MINOR``. - -``ZLIB_PATCH_VERSION`` - The patch version of zlib. Superseded by ``ZLIB_VERSION_PATCH``. - Hints ^^^^^ @@ -100,6 +60,59 @@ Set this variable to ``ON`` before calling ``find_package(ZLIB)`` to look for static libraries. Default is ``OFF``. +Deprecated Variables +^^^^^^^^^^^^^^^^^^^^ + +The following variables are provided for backward compatibility: + +``ZLIB_VERSION_MAJOR`` + .. deprecated:: 3.26 + Superseded by ``ZLIB_VERSION``. + + The major version of zlib. + +``ZLIB_VERSION_MINOR`` + .. deprecated:: 3.26 + Superseded by ``ZLIB_VERSION``. + + The minor version of zlib. + +``ZLIB_VERSION_PATCH`` + .. deprecated:: 3.26 + Superseded by ``ZLIB_VERSION``. + + The patch version of zlib. + +``ZLIB_VERSION_TWEAK`` + .. deprecated:: 3.26 + Superseded by ``ZLIB_VERSION``. + + The tweak version of zlib. + +``ZLIB_VERSION_STRING`` + .. deprecated:: 3.26 + Superseded by ``ZLIB_VERSION``. + + The version of zlib found (x.y.z). + +``ZLIB_MAJOR_VERSION`` + .. deprecated:: 3.26 + Superseded by ``ZLIB_VERSION``. + + The major version of zlib. + +``ZLIB_MINOR_VERSION`` + .. deprecated:: 3.26 + Superseded by ``ZLIB_VERSION``. + + The minor version of zlib. + +``ZLIB_PATCH_VERSION`` + .. deprecated:: 3.26 + Superseded by ``ZLIB_VERSION``. + + The patch version of zlib. + Examples ^^^^^^^^
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 352c737..48c7b49 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake
@@ -393,6 +393,7 @@ set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --msvc-ver=${MSVC_VERSION} --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ") set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --msvc-ver=${MSVC_VERSION} --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ") endif() + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "") if(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") set(_DLL_DRIVER "-driver") else()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 29db1ee..b4a11cb 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 4) set(CMake_VERSION_MINOR 1) -set(CMake_VERSION_PATCH 20250801) +set(CMake_VERSION_PATCH 20250804) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CTest/cmCTestResourceAllocator.cxx b/Source/CTest/cmCTestResourceAllocator.cxx index a7ae7bc..8aa2152 100644 --- a/Source/CTest/cmCTestResourceAllocator.cxx +++ b/Source/CTest/cmCTestResourceAllocator.cxx
@@ -72,15 +72,3 @@ resIt->second.Locked -= slots; return true; } - -bool cmCTestResourceAllocator::Resource::operator==( - Resource const& other) const -{ - return this->Total == other.Total && this->Locked == other.Locked; -} - -bool cmCTestResourceAllocator::Resource::operator!=( - Resource const& other) const -{ - return !(*this == other); -}
diff --git a/Source/CTest/cmCTestResourceAllocator.h b/Source/CTest/cmCTestResourceAllocator.h index fcb5ef6..cf83c57 100644 --- a/Source/CTest/cmCTestResourceAllocator.h +++ b/Source/CTest/cmCTestResourceAllocator.h
@@ -17,8 +17,15 @@ unsigned int Free() const { return this->Total - this->Locked; } - bool operator==(Resource const& other) const; - bool operator!=(Resource const& other) const; + friend bool operator==(Resource left, Resource right) + { + return left.Total == right.Total && left.Locked == right.Locked; + } + + friend bool operator!=(Resource left, Resource right) + { + return !(left == right); + } }; void InitializeFromResourceSpec(cmCTestResourceSpec const& spec);
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index a39cb7b..0c64f3f 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -530,7 +530,7 @@ void cmCTestTestHandler::LogTestSummary(std::vector<std::string> const& passed, std::vector<std::string> const& failed, - cmDuration const& durationInSecs) + cmDuration durationInSecs) { std::size_t total = passed.size() + failed.size();
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 9388425..83aae98 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h
@@ -242,7 +242,7 @@ bool ProcessOptions(); void LogTestSummary(std::vector<std::string> const& passed, std::vector<std::string> const& failed, - cmDuration const& durationInSecs); + cmDuration durationInSecs); void LogDisabledTests(std::vector<cmCTestTestResult> const& disabledTests); void LogFailedTests(std::vector<std::string> const& failed, SetOfTests const& resultsSet);
diff --git a/Source/cmArgumentParser.cxx b/Source/cmArgumentParser.cxx index 2ea2e6a..765e9cb 100644 --- a/Source/cmArgumentParser.cxx +++ b/Source/cmArgumentParser.cxx
@@ -14,11 +14,9 @@ auto KeywordActionMap::Emplace(cm::string_view name, KeywordAction action) -> std::pair<iterator, bool> { - auto const it = - std::lower_bound(this->begin(), this->end(), name, - [](value_type const& elem, cm::string_view const& k) { - return elem.first < k; - }); + auto const it = std::lower_bound( + this->begin(), this->end(), name, + [](value_type const& elem, cm::string_view k) { return elem.first < k; }); return (it != this->end() && it->first == name) ? std::make_pair(it, false) : std::make_pair(this->emplace(it, name, std::move(action)), true); @@ -26,11 +24,9 @@ auto KeywordActionMap::Find(cm::string_view name) const -> const_iterator { - auto const it = - std::lower_bound(this->begin(), this->end(), name, - [](value_type const& elem, cm::string_view const& k) { - return elem.first < k; - }); + auto const it = std::lower_bound( + this->begin(), this->end(), name, + [](value_type const& elem, cm::string_view k) { return elem.first < k; }); return (it != this->end() && it->first == name) ? it : this->end(); }
diff --git a/Source/cmBuildOptions.h b/Source/cmBuildOptions.h index f84b576..a10b69f 100644 --- a/Source/cmBuildOptions.h +++ b/Source/cmBuildOptions.h
@@ -35,8 +35,6 @@ , ResolveMode(resolveMode) { } - explicit cmBuildOptions(cmBuildOptions const&) noexcept = default; - cmBuildOptions& operator=(cmBuildOptions const&) noexcept = default; bool Clean = false; bool Fast = false;
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index ed23958..1d3f933 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx
@@ -779,7 +779,7 @@ } std::pair<size_t, bool> cmComputeLinkDepends::AddLinkEntry( - cmLinkItem const& item, cm::optional<size_t> const& groupIndex) + cmLinkItem const& item, cm::optional<size_t> groupIndex) { // Allocate a spot for the item entry. auto lei = this->AllocateLinkEntry(item); @@ -950,7 +950,7 @@ } void cmComputeLinkDepends::AddVarLinkEntries( - cm::optional<size_t> const& depender_index, char const* value) + cm::optional<size_t> depender_index, char const* value) { // This is called to add the dependencies named by // <item>_LIB_DEPENDS. The variable contains a semicolon-separated @@ -1020,8 +1020,8 @@ } template <typename T> -void cmComputeLinkDepends::AddLinkEntries( - cm::optional<size_t> const& depender_index, std::vector<T> const& libs) +void cmComputeLinkDepends::AddLinkEntries(cm::optional<size_t> depender_index, + std::vector<T> const& libs) { // Track inferred dependency sets implied by this list. std::map<size_t, DependSet> dependSets; @@ -1305,7 +1305,7 @@ } cmLinkItem cmComputeLinkDepends::ResolveLinkItem( - cm::optional<size_t> const& depender_index, std::string const& name) + cm::optional<size_t> depender_index, std::string const& name) { // Look for a target in the scope of the depender. cmGeneratorTarget const* from = this->Target;
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index a82db2b..0724561 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h
@@ -106,16 +106,16 @@ std::pair<std::map<cmLinkItem, size_t>::iterator, bool> AllocateLinkEntry( cmLinkItem const& item); std::pair<size_t, bool> AddLinkEntry(cmLinkItem const& item, - cm::optional<size_t> const& groupIndex); + cm::optional<size_t> groupIndex); void AddLinkObject(cmLinkItem const& item); - void AddVarLinkEntries(cm::optional<size_t> const& depender_index, + void AddVarLinkEntries(cm::optional<size_t> depender_index, char const* value); void AddDirectLinkEntries(); template <typename T> - void AddLinkEntries(cm::optional<size_t> const& depender_index, + void AddLinkEntries(cm::optional<size_t> depender_index, std::vector<T> const& libs); void AddLinkObjects(std::vector<cmLinkItem> const& objs); - cmLinkItem ResolveLinkItem(cm::optional<size_t> const& depender_index, + cmLinkItem ResolveLinkItem(cm::optional<size_t> depender_index, std::string const& name); // One entry for each unique item.
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 4a2f163..721f29f 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx
@@ -236,7 +236,7 @@ } Arguments cmCoreTryCompile::ParseArgs( - cmRange<std::vector<std::string>::const_iterator> const& args, + cmRange<std::vector<std::string>::const_iterator> args, cmArgumentParser<Arguments> const& parser, std::vector<std::string>& unparsedArguments) {
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index 41d712f..3c36456 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h
@@ -161,8 +161,7 @@ std::string WriteSource(std::string const& name, std::string const& content, char const* command) const; - Arguments ParseArgs( - cmRange<std::vector<std::string>::const_iterator> const& args, - cmArgumentParser<Arguments> const& parser, - std::vector<std::string>& unparsedArguments); + Arguments ParseArgs(cmRange<std::vector<std::string>::const_iterator> args, + cmArgumentParser<Arguments> const& parser, + std::vector<std::string>& unparsedArguments); };
diff --git a/Source/cmDebuggerAdapter.cxx b/Source/cmDebuggerAdapter.cxx index 7dc6e7f..7cf9efe 100644 --- a/Source/cmDebuggerAdapter.cxx +++ b/Source/cmDebuggerAdapter.cxx
@@ -164,8 +164,7 @@ }); // https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Threads - Session->registerHandler([this](dap::ThreadsRequest const& req) { - (void)req; + Session->registerHandler([this](dap::ThreadsRequest /*unused*/) { std::unique_lock<std::mutex> lock(Mutex); dap::ThreadsResponse response; @@ -196,7 +195,7 @@ }); // https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Scopes - Session->registerHandler([this](dap::ScopesRequest const& request) + Session->registerHandler([this](dap::ScopesRequest request) -> dap::ResponseOrError<dap::ScopesResponse> { std::unique_lock<std::mutex> lock(Mutex); return DefaultThread->GetScopesResponse(request.frameId, @@ -210,8 +209,7 @@ }); // https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Pause - Session->registerHandler([this](dap::PauseRequest const& req) { - (void)req; + Session->registerHandler([this](dap::PauseRequest /*unused*/) { PauseRequest.store(true); return dap::PauseResponse(); }); @@ -286,8 +284,7 @@ // The ConfigurationDone request is made by the client once all configuration // requests have been made. // https://microsoft.github.io/debug-adapter-protocol/specification#Requests_ConfigurationDone - Session->registerHandler([this](dap::ConfigurationDoneRequest const& req) { - (void)req; + Session->registerHandler([this](dap::ConfigurationDoneRequest /*unused*/) { ConfigurationDoneEvent->Fire(); return dap::ConfigurationDoneResponse(); }); @@ -397,7 +394,7 @@ dap::array<dap::integer> hitBreakpoints; hitBreakpoints.resize(hits.size()); std::transform(hits.begin(), hits.end(), hitBreakpoints.begin(), - [&](int64_t const& id) { return dap::integer(id); }); + [&](int64_t id) { return dap::integer(id); }); stoppedEvent.reason = "breakpoint"; stoppedEvent.hitBreakpointIds = hitBreakpoints; }
diff --git a/Source/cmDebuggerBreakpointManager.cxx b/Source/cmDebuggerBreakpointManager.cxx index dfd131c..b33985b 100644 --- a/Source/cmDebuggerBreakpointManager.cxx +++ b/Source/cmDebuggerBreakpointManager.cxx
@@ -33,7 +33,7 @@ auto location = find_if(ListFileFunctionLines[sourcePath].begin(), ListFileFunctionLines[sourcePath].end(), - [=](cmDebuggerFunctionLocation const& loc) { + [=](cmDebuggerFunctionLocation loc) { return loc.StartLine <= line && loc.EndLine >= line; }); @@ -47,11 +47,10 @@ int64_t cmDebuggerBreakpointManager::CalibrateBreakpointLine( std::string const& sourcePath, int64_t line) { - auto location = find_if(ListFileFunctionLines[sourcePath].begin(), - ListFileFunctionLines[sourcePath].end(), - [=](cmDebuggerFunctionLocation const& loc) { - return loc.StartLine >= line; - }); + auto location = find_if( + ListFileFunctionLines[sourcePath].begin(), + ListFileFunctionLines[sourcePath].end(), + [=](cmDebuggerFunctionLocation loc) { return loc.StartLine >= line; }); if (location != ListFileFunctionLines[sourcePath].end()) { return location->StartLine;
diff --git a/Source/cmDebuggerExceptionManager.cxx b/Source/cmDebuggerExceptionManager.cxx index a2744e1..22a577a 100644 --- a/Source/cmDebuggerExceptionManager.cxx +++ b/Source/cmDebuggerExceptionManager.cxx
@@ -25,8 +25,7 @@ }); // https://microsoft.github.io/debug-adapter-protocol/specification#Requests_ExceptionInfo - DapSession->registerHandler([&](dap::ExceptionInfoRequest const& request) { - (void)request; + DapSession->registerHandler([&](dap::ExceptionInfoRequest /*unused*/) { return HandleExceptionInfoRequest(); });
diff --git a/Source/cmDebuggerVariablesHelper.cxx b/Source/cmDebuggerVariablesHelper.cxx index b8bc328..efe5c89 100644 --- a/Source/cmDebuggerVariablesHelper.cxx +++ b/Source/cmDebuggerVariablesHelper.cxx
@@ -83,8 +83,7 @@ std::shared_ptr<cmDebuggerVariables> cmDebuggerVariablesHelper::CreateIfAny( std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager, - std::string const& name, bool supportsVariableType, - cmBTStringRange const& entries) + std::string const& name, bool supportsVariableType, cmBTStringRange entries) { if (entries.empty()) { return {};
diff --git a/Source/cmDebuggerVariablesHelper.h b/Source/cmDebuggerVariablesHelper.h index e39a857..0e0fdb4 100644 --- a/Source/cmDebuggerVariablesHelper.h +++ b/Source/cmDebuggerVariablesHelper.h
@@ -48,7 +48,7 @@ static std::shared_ptr<cmDebuggerVariables> CreateIfAny( std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager, std::string const& name, bool supportsVariableType, - cmBTStringRange const& entries); + cmBTStringRange entries); static std::shared_ptr<cmDebuggerVariables> CreateIfAny( std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
diff --git a/Source/cmDuration.cxx b/Source/cmDuration.cxx index b017d0a..7981e77 100644 --- a/Source/cmDuration.cxx +++ b/Source/cmDuration.cxx
@@ -4,7 +4,7 @@ #include "cmDuration.h" template <typename T> -T cmDurationTo(cmDuration const& duration) +T cmDurationTo(cmDuration duration) { /* This works because the comparison operators for duration rely on * std::common_type. @@ -23,5 +23,5 @@ .count(); } -template int cmDurationTo<int>(cmDuration const&); -template unsigned int cmDurationTo<unsigned int>(cmDuration const&); +template int cmDurationTo<int>(cmDuration); +template unsigned int cmDurationTo<unsigned int>(cmDuration);
diff --git a/Source/cmDuration.h b/Source/cmDuration.h index c0268f9..378af9c 100644 --- a/Source/cmDuration.h +++ b/Source/cmDuration.h
@@ -16,9 +16,9 @@ * the permissible valid values for T. */ template <typename T> -T cmDurationTo(cmDuration const& duration); +T cmDurationTo(cmDuration duration); #ifndef CMDURATION_CPP -extern template int cmDurationTo<int>(cmDuration const&); -extern template unsigned int cmDurationTo<unsigned int>(cmDuration const&); +extern template int cmDurationTo<int>(cmDuration); +extern template unsigned int cmDurationTo<unsigned int>(cmDuration); #endif
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 477453d..fdf0dbd 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx
@@ -215,7 +215,7 @@ cmGeneratorExpression::Split(exportDirs, entries); exportDirs.clear(); char const* sep = ""; - cm::string_view const& prefixWithSlash = this->GetImportPrefixWithSlash(); + cm::string_view const prefixWithSlash = this->GetImportPrefixWithSlash(); for (std::string const& e : entries) { exportDirs += sep; sep = ";";
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h index 2df3264..85da195 100644 --- a/Source/cmExportInstallFileGenerator.h +++ b/Source/cmExportInstallFileGenerator.h
@@ -75,7 +75,7 @@ std::string GetInstallPrefix() const { - cm::string_view const& prefixWithSlash = this->GetImportPrefixWithSlash(); + cm::string_view const prefixWithSlash = this->GetImportPrefixWithSlash(); return std::string(prefixWithSlash.data(), prefixWithSlash.length() - 1); } virtual char GetConfigFileNameSeparator() const = 0;
diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index 0e13003..216b1c6 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx
@@ -29,6 +29,20 @@ #include "cmTimestamp.h" #include "cmake.h" +#if defined(__clang__) && defined(__has_warning) +# if __has_warning("-Wrange-loop-analysis") +# if defined(__apple_build_version__) +# if __apple_build_version__ < 13000000 +# define CM_CLANG_SUPPRESS_WARN_RANGE_LOOP_ANALYSIS +# endif +# else +# if __clang_major__ < 11 +# define CM_CLANG_SUPPRESS_WARN_RANGE_LOOP_ANALYSIS +# endif +# endif +# endif +#endif + cmFileAPI::cmFileAPI(cmake* cm) : CMakeInstance(cm) { @@ -89,7 +103,14 @@ { std::vector<unsigned int> versions; auto getConfigureLogVersions = [&versions](Query const& q) { - for (Object const& o : q.Known) { +#ifdef CM_CLANG_SUPPRESS_WARN_RANGE_LOOP_ANALYSIS +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wrange-loop-analysis" +#endif + for (Object const o : q.Known) { +#ifdef CM_CLANG_SUPPRESS_WARN_RANGE_LOOP_ANALYSIS +# pragma clang diagnostic pop +#endif if (o.Kind == ObjectKind::ConfigureLog) { versions.emplace_back(o.Version); } @@ -446,7 +467,14 @@ Json::Value cmFileAPI::BuildReply(Query const& q) { Json::Value reply = Json::objectValue; - for (Object const& o : q.Known) { +#ifdef CM_CLANG_SUPPRESS_WARN_RANGE_LOOP_ANALYSIS +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wrange-loop-analysis" +#endif + for (Object const o : q.Known) { +#ifdef CM_CLANG_SUPPRESS_WARN_RANGE_LOOP_ANALYSIS +# pragma clang diagnostic pop +#endif std::string const& name = ObjectName(o); reply[name] = this->BuildReplyEntry(o); } @@ -457,7 +485,7 @@ return reply; } -Json::Value cmFileAPI::BuildReplyEntry(Object const& object) +Json::Value cmFileAPI::BuildReplyEntry(Object object) { if (this->ReplyIndexFor != IndexFor::Success) { switch (object.Kind) { @@ -481,7 +509,7 @@ return e; } -Json::Value const& cmFileAPI::AddReplyIndexObject(Object const& o) +Json::Value const& cmFileAPI::AddReplyIndexObject(Object o) { Json::Value& indexEntry = this->ReplyIndexObjects[o]; if (!indexEntry.isNull()) { @@ -515,7 +543,7 @@ return objectKindNames[static_cast<size_t>(kind)]; } -std::string cmFileAPI::ObjectName(Object const& o) +std::string cmFileAPI::ObjectName(Object o) { std::string name = cmStrCat(ObjectKindName(o.Kind), "-v", o.Version); return name; @@ -529,7 +557,7 @@ return version; } -Json::Value cmFileAPI::BuildObject(Object const& object) +Json::Value cmFileAPI::BuildObject(Object object) { Json::Value value; @@ -809,7 +837,7 @@ } } -Json::Value cmFileAPI::BuildCodeModel(Object const& object) +Json::Value cmFileAPI::BuildCodeModel(Object object) { assert(object.Version == 2); Json::Value codemodel = @@ -846,7 +874,7 @@ } } -Json::Value cmFileAPI::BuildConfigureLog(Object const& object) +Json::Value cmFileAPI::BuildConfigureLog(Object object) { Json::Value configureLog = cmFileAPIConfigureLogDump(*this, object.Version); configureLog["kind"] = this->ObjectKindName(object.Kind); @@ -880,7 +908,7 @@ } } -Json::Value cmFileAPI::BuildCache(Object const& object) +Json::Value cmFileAPI::BuildCache(Object object) { Json::Value cache = cmFileAPICacheDump(*this, object.Version); cache["kind"] = this->ObjectKindName(object.Kind); @@ -914,7 +942,7 @@ } } -Json::Value cmFileAPI::BuildCMakeFiles(Object const& object) +Json::Value cmFileAPI::BuildCMakeFiles(Object object) { Json::Value cmakeFiles = cmFileAPICMakeFilesDump(*this, object.Version); cmakeFiles["kind"] = this->ObjectKindName(object.Kind); @@ -948,7 +976,7 @@ } } -Json::Value cmFileAPI::BuildToolchains(Object const& object) +Json::Value cmFileAPI::BuildToolchains(Object object) { Json::Value toolchains = cmFileAPIToolchainsDump(*this, object.Version); toolchains["kind"] = this->ObjectKindName(object.Kind); @@ -984,7 +1012,7 @@ } } -Json::Value cmFileAPI::BuildInternalTest(Object const& object) +Json::Value cmFileAPI::BuildInternalTest(Object object) { Json::Value test = Json::objectValue; test["kind"] = this->ObjectKindName(object.Kind);
diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h index 5d255d4..2e25111 100644 --- a/Source/cmFileAPI.h +++ b/Source/cmFileAPI.h
@@ -87,21 +87,18 @@ { ObjectKind Kind; unsigned int Version = 0; - friend bool operator<(Object const& l, Object const& r) + friend bool operator<(Object l, Object r) { if (l.Kind != r.Kind) { return l.Kind < r.Kind; } return l.Version < r.Version; } - friend bool operator==(Object const& l, Object const& r) + friend bool operator==(Object l, Object r) { return l.Kind == r.Kind && l.Version == r.Version; } - friend bool operator!=(Object const& l, Object const& r) - { - return !(l == r); - } + friend bool operator!=(Object l, Object r) { return !(l == r); } }; /** Represent content of a query directory. */ @@ -192,14 +189,14 @@ Json::Value BuildReplyIndex(); Json::Value BuildCMake(); Json::Value BuildReply(Query const& q); - Json::Value BuildReplyEntry(Object const& object); + Json::Value BuildReplyEntry(Object object); static Json::Value BuildReplyError(std::string const& error); - Json::Value const& AddReplyIndexObject(Object const& o); + Json::Value const& AddReplyIndexObject(Object o); static char const* ObjectKindName(ObjectKind kind); - static std::string ObjectName(Object const& o); + static std::string ObjectName(Object o); - Json::Value BuildObject(Object const& object); + Json::Value BuildObject(Object object); ClientRequests BuildClientRequests(Json::Value const& requests); ClientRequest BuildClientRequest(Json::Value const& request); @@ -223,25 +220,25 @@ void BuildClientRequestCodeModel( ClientRequest& r, std::vector<RequestVersion> const& versions); - Json::Value BuildCodeModel(Object const& object); + Json::Value BuildCodeModel(Object object); void BuildClientRequestConfigureLog( ClientRequest& r, std::vector<RequestVersion> const& versions); - Json::Value BuildConfigureLog(Object const& object); + Json::Value BuildConfigureLog(Object object); void BuildClientRequestCache(ClientRequest& r, std::vector<RequestVersion> const& versions); - Json::Value BuildCache(Object const& object); + Json::Value BuildCache(Object object); void BuildClientRequestCMakeFiles( ClientRequest& r, std::vector<RequestVersion> const& versions); - Json::Value BuildCMakeFiles(Object const& object); + Json::Value BuildCMakeFiles(Object object); void BuildClientRequestToolchains( ClientRequest& r, std::vector<RequestVersion> const& versions); - Json::Value BuildToolchains(Object const& object); + Json::Value BuildToolchains(Object object); void BuildClientRequestInternalTest( ClientRequest& r, std::vector<RequestVersion> const& versions); - Json::Value BuildInternalTest(Object const& object); + Json::Value BuildInternalTest(Object object); };
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 88f9f0c..057b3fa 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx
@@ -3848,7 +3848,7 @@ return true; } -bool SetPermissions(std::string const& filename, mode_t const& perms, +bool SetPermissions(std::string const& filename, mode_t perms, cmExecutionStatus& status) { if (!cmSystemTools::SetPermissions(filename, perms)) { @@ -3953,8 +3953,7 @@ if (cmSystemTools::FileExists(i, true)) { bool success = true; - mode_t const& filePermissions = - parsedArgs.FilePermissions ? fperms : perms; + mode_t filePermissions = parsedArgs.FilePermissions ? fperms : perms; if (filePermissions) { success = SetPermissions(i, filePermissions, status); } @@ -3965,7 +3964,7 @@ else if (cmSystemTools::FileIsDirectory(i)) { bool success = true; - mode_t const& directoryPermissions = + mode_t directoryPermissions = parsedArgs.DirectoryPermissions ? dperms : perms; if (directoryPermissions) { success = SetPermissions(i, directoryPermissions, status);
diff --git a/Source/cmFileTime.h b/Source/cmFileTime.h index 52ecf50..7887bf1 100644 --- a/Source/cmFileTime.h +++ b/Source/cmFileTime.h
@@ -22,10 +22,6 @@ // unit time is 100 nanosecond static constexpr TimeType UtPerS = 10000000; #endif - cmFileTime() = default; - ~cmFileTime() = default; - cmFileTime(cmFileTime const&) = default; - cmFileTime& operator=(cmFileTime const&) = default; /** * @brief Loads the file time of fileName from the file system @@ -36,34 +32,28 @@ /** * @brief Return true if this is older than ftm */ - bool Older(cmFileTime const& ftm) const - { - return (this->Time - ftm.Time) < 0; - } + bool Older(cmFileTime ftm) const { return (this->Time - ftm.Time) < 0; } /** * @brief Return true if this is newer than ftm */ - bool Newer(cmFileTime const& ftm) const - { - return (ftm.Time - this->Time) < 0; - } + bool Newer(cmFileTime ftm) const { return (ftm.Time - this->Time) < 0; } /** * @brief Return true if this is the same as ftm */ - bool Equal(cmFileTime const& ftm) const { return this->Time == ftm.Time; } + bool Equal(cmFileTime ftm) const { return this->Time == ftm.Time; } /** * @brief Return true if this is not the same as ftm */ - bool Differ(cmFileTime const& ftm) const { return this->Time != ftm.Time; } + bool Differ(cmFileTime ftm) const { return this->Time != ftm.Time; } /** * @brief Compare file modification times. * @return -1, 0, +1 for this older, same, or newer than ftm. */ - int Compare(cmFileTime const& ftm) const + int Compare(cmFileTime ftm) const { TimeType const diff = this->Time - ftm.Time; if (diff == 0) { @@ -77,7 +67,7 @@ /** * @brief Return true if this is at least a second older than ftm */ - bool OlderS(cmFileTime const& ftm) const + bool OlderS(cmFileTime ftm) const { return (ftm.Time - this->Time) >= cmFileTime::UtPerS; } @@ -85,7 +75,7 @@ /** * @brief Return true if this is at least a second newer than ftm */ - bool NewerS(cmFileTime const& ftm) const + bool NewerS(cmFileTime ftm) const { return (this->Time - ftm.Time) >= cmFileTime::UtPerS; } @@ -93,7 +83,7 @@ /** * @brief Return true if this is within the same second as ftm */ - bool EqualS(cmFileTime const& ftm) const + bool EqualS(cmFileTime ftm) const { TimeType diff = this->Time - ftm.Time; if (diff < 0) { @@ -105,7 +95,7 @@ /** * @brief Return true if this is older or newer than ftm by at least a second */ - bool DifferS(cmFileTime const& ftm) const + bool DifferS(cmFileTime ftm) const { TimeType diff = this->Time - ftm.Time; if (diff < 0) { @@ -119,7 +109,7 @@ * @return -1: this at least a second older, 0: this within the same second * as ftm, +1: this at least a second newer than ftm. */ - int CompareS(cmFileTime const& ftm) const + int CompareS(cmFileTime ftm) const { TimeType const diff = this->Time - ftm.Time; if (diff <= -cmFileTime::UtPerS) {
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index f35ee52..24a66c4 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx
@@ -214,7 +214,7 @@ } static void prefixItems(std::string const& content, std::string& result, - cm::string_view const& prefix) + cm::string_view prefix) { std::vector<std::string> entries; cmGeneratorExpression::Split(content, entries); @@ -401,8 +401,7 @@ return extractAllGeneratorExpressions(input, &collected); } -cm::string_view::size_type cmGeneratorExpression::Find( - cm::string_view const& input) +cm::string_view::size_type cmGeneratorExpression::Find(cm::string_view input) { cm::string_view::size_type const openpos = input.find("$<"); if (openpos != cm::string_view::npos &&
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index e5269b1..bda35f4 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h
@@ -70,7 +70,7 @@ static void Split(std::string const& input, std::vector<std::string>& output); - static cm::string_view::size_type Find(cm::string_view const& input); + static cm::string_view::size_type Find(cm::string_view input); static bool IsValidTargetName(std::string const& input);
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 8137cb6..220fbab 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx
@@ -702,7 +702,7 @@ } bool CheckPathParameters(cmGeneratorExpressionContext* ctx, GeneratorExpressionContent const* cnt, - cm::string_view option, Arguments const& args, + cm::string_view option, Arguments args, int required = 1) { return CheckPathParametersEx(ctx, cnt, option, args.size(), required); @@ -1190,7 +1190,7 @@ } inline bool CheckListParameters(cmGeneratorExpressionContext* ctx, GeneratorExpressionContent const* cnt, - cm::string_view option, Arguments const& args, + cm::string_view option, Arguments args, int required = 1) { return CheckListParametersEx(ctx, cnt, option, args.size(), required); @@ -1225,7 +1225,7 @@ bool GetNumericArguments( cmGeneratorExpressionContext* ctx, GeneratorExpressionContent const* cnt, - Arguments const& args, std::vector<cmList::index_type>& indexes, + Arguments args, std::vector<cmList::index_type>& indexes, cmList::ExpandElements expandElements = cmList::ExpandElements::No) { using IndexRange = cmRange<Arguments::const_iterator>;
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index cff01d7..adb3704 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -72,8 +72,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int /*jobs*/, bool verbose, - cmBuildOptions const& buildOptions, - std::vector<std::string> const& makeOptions) + cmBuildOptions buildOptions, std::vector<std::string> const& makeOptions) { return this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand( makeProgram, projectName, projectDir, targetNames, config,
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 6857a2e..a59b19f 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -63,7 +63,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 76a03bd..0ff2158 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx
@@ -2167,7 +2167,7 @@ std::string const& /*unused*/, std::string const& /*unused*/, std::string const& /*unused*/, std::vector<std::string> const& /*unused*/, std::string const& /*unused*/, int /*unused*/, bool /*unused*/, - cmBuildOptions const& /*unused*/, std::vector<std::string> const& /*unused*/) + cmBuildOptions /*unused*/, std::vector<std::string> const& /*unused*/) { GeneratedMakeCommand makeCommand; makeCommand.Add("cmGlobalGenerator::GenerateBuildCommand not implemented"); @@ -2185,7 +2185,7 @@ int jobs, std::string const& /*unused*/, std::string const& bindir, std::string const& projectName, std::vector<std::string> const& targets, std::ostream& ostr, std::string const& makeCommandCSTR, - std::string const& config, cmBuildOptions const& buildOptions, bool verbose, + std::string const& config, cmBuildOptions buildOptions, bool verbose, cmDuration timeout, cmSystemTools::OutputOption outputMode, std::vector<std::string> const& nativeOptions) {
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index aac687b..ad3d350 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h
@@ -254,8 +254,8 @@ std::string const& projectName, std::vector<std::string> const& targetNames, std::ostream& ostr, std::string const& makeProgram, std::string const& config, - cmBuildOptions const& buildOptions, bool verbose, - cmDuration timeout, cmSystemTools::OutputOption outputMode, + cmBuildOptions buildOptions, bool verbose, cmDuration timeout, + cmSystemTools::OutputOption outputMode, std::vector<std::string> const& nativeOptions = std::vector<std::string>()); @@ -273,7 +273,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()); virtual void PrintBuildCommandAdvice(std::ostream& os, int jobs) const;
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index e918268..9487153 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -470,8 +470,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& /*config*/, int jobs, bool verbose, - cmBuildOptions const& /*buildOptions*/, - std::vector<std::string> const& makeOptions) + cmBuildOptions /*buildOptions*/, std::vector<std::string> const& makeOptions) { GeneratedMakeCommand makeCommand;
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h index c0bc7be..e51c7ed 100644 --- a/Source/cmGlobalGhsMultiGenerator.h +++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -86,7 +86,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override; void AddExtraIDETargets() override;
diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index a918ee0..76327ed 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/Source/cmGlobalJOMMakefileGenerator.cxx
@@ -63,8 +63,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions, - std::vector<std::string> const& makeOptions) + cmBuildOptions buildOptions, std::vector<std::string> const& makeOptions) { std::vector<std::string> jomMakeOptions;
diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index b89c22f..0199dff 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h
@@ -54,7 +54,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 8209709..069a70a 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -106,8 +106,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int /*jobs*/, bool verbose, - cmBuildOptions const& buildOptions, - std::vector<std::string> const& makeOptions) + cmBuildOptions buildOptions, std::vector<std::string> const& makeOptions) { std::vector<std::string> nmakeMakeOptions;
diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index 0589f2b..54de4db 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h
@@ -61,7 +61,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 7a2c36a..943f149 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1001,7 +1001,7 @@ std::string const& makeProgram, std::string const& /*projectName*/, std::string const& /*projectDir*/, std::vector<std::string> const& targetNames, std::string const& config, - int jobs, bool verbose, cmBuildOptions const& /*buildOptions*/, + int jobs, bool verbose, cmBuildOptions /*buildOptions*/, std::vector<std::string> const& makeOptions) { GeneratedMakeCommand makeCommand;
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 6fac392..8d80d13 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h
@@ -201,7 +201,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index d2c2692..fb7a4cf 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -536,7 +536,7 @@ std::string const& makeProgram, std::string const& /*projectName*/, std::string const& /*projectDir*/, std::vector<std::string> const& targetNames, std::string const& /*config*/, - int jobs, bool verbose, cmBuildOptions const& buildOptions, + int jobs, bool verbose, cmBuildOptions buildOptions, std::vector<std::string> const& makeOptions) { GeneratedMakeCommand makeCommand;
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 2d46f88..58755c0 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -172,7 +172,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 129b326..70003fb 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -1050,8 +1050,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions, - std::vector<std::string> const& makeOptions) + cmBuildOptions buildOptions, std::vector<std::string> const& makeOptions) { std::vector<GeneratedMakeCommand> makeCommands; // Select the caller- or user-preferred make program, else MSBuild.
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 386e12f..a886be5 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -38,7 +38,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 83eff0d..ee80949 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -217,7 +217,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& /*projectDir*/, std::vector<std::string> const& targetNames, std::string const& config, - int /*jobs*/, bool /*verbose*/, cmBuildOptions const& /*buildOptions*/, + int /*jobs*/, bool /*verbose*/, cmBuildOptions /*buildOptions*/, std::vector<std::string> const& makeOptions) { // Select the caller- or user-preferred make program, else devenv.
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index c4f45b6..b2fdeb6 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -78,7 +78,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index 55d3a8d..8061448 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -67,8 +67,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int /*jobs*/, bool verbose, - cmBuildOptions const& buildOptions, - std::vector<std::string> const& makeOptions) + cmBuildOptions buildOptions, std::vector<std::string> const& makeOptions) { return this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand( makeProgram, projectName, projectDir, targetNames, config,
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index 6f00d55..84ec7f8 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -62,7 +62,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 314349a..28c47aa 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -545,7 +545,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& /*projectDir*/, std::vector<std::string> const& targetNames, std::string const& config, - int jobs, bool /*verbose*/, cmBuildOptions const& /*buildOptions*/, + int jobs, bool /*verbose*/, cmBuildOptions /*buildOptions*/, std::vector<std::string> const& makeOptions) { std::string const xcodebuild =
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index a4dbde5..55c1dd3 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h
@@ -81,7 +81,7 @@ std::string const& makeProgram, std::string const& projectName, std::string const& projectDir, std::vector<std::string> const& targetNames, std::string const& config, int jobs, bool verbose, - cmBuildOptions const& buildOptions = cmBuildOptions(), + cmBuildOptions buildOptions = cmBuildOptions(), std::vector<std::string> const& makeOptions = std::vector<std::string>()) override;
diff --git a/Source/cmInstallGetRuntimeDependenciesGenerator.cxx b/Source/cmInstallGetRuntimeDependenciesGenerator.cxx index 9e1ecc1..0ba9f14 100644 --- a/Source/cmInstallGetRuntimeDependenciesGenerator.cxx +++ b/Source/cmInstallGetRuntimeDependenciesGenerator.cxx
@@ -24,7 +24,7 @@ namespace { template <typename T, typename F> -void WriteMultiArgument(std::ostream& os, cm::string_view const& keyword, +void WriteMultiArgument(std::ostream& os, cm::string_view keyword, std::vector<T> const& list, cmScriptGeneratorIndent indent, F transform) { @@ -42,7 +42,7 @@ } void WriteFilesArgument( - std::ostream& os, cm::string_view const& keyword, + std::ostream& os, cm::string_view keyword, std::vector<std::unique_ptr<cmInstallRuntimeDependencySet::Item>> const& items, std::string const& config, cmScriptGeneratorIndent indent) @@ -53,8 +53,7 @@ -> std::string { return cmStrCat('"', i->GetItemPath(config), '"'); }); } -void WriteGenexEvaluatorArgument(std::ostream& os, - cm::string_view const& keyword, +void WriteGenexEvaluatorArgument(std::ostream& os, cm::string_view keyword, std::vector<std::string> const& genexes, std::string const& config, cmLocalGenerator* lg,
diff --git a/Source/cmJSONHelpers.h b/Source/cmJSONHelpers.h index a5f71dd..ab96c64 100644 --- a/Source/cmJSONHelpers.h +++ b/Source/cmJSONHelpers.h
@@ -96,7 +96,7 @@ } template <typename U, typename M, typename F> - Object& Bind(cm::string_view const& name, M U::*member, F func, + Object& Bind(cm::string_view name, M U::*member, F func, bool required = true) { return this->BindPrivate( @@ -106,7 +106,7 @@ required); } template <typename M, typename F> - Object& Bind(cm::string_view const& name, std::nullptr_t, F func, + Object& Bind(cm::string_view name, std::nullptr_t, F func, bool required = true) { return this->BindPrivate( @@ -119,7 +119,7 @@ required); } template <typename F> - Object& Bind(cm::string_view const& name, F func, bool required = true) + Object& Bind(cm::string_view name, F func, bool required = true) { return this->BindPrivate(name, MemberFunction(func), required); } @@ -197,7 +197,7 @@ JsonErrors::ObjectErrorGenerator Error; bool AllowExtra; - Object& BindPrivate(cm::string_view const& name, MemberFunction&& func, + Object& BindPrivate(cm::string_view name, MemberFunction&& func, bool required) { this->Members.emplace_back(name, std::move(func), required);
diff --git a/Source/cmList.cxx b/Source/cmList.cxx index 77b7916..9087457 100644 --- a/Source/cmList.cxx +++ b/Source/cmList.cxx
@@ -134,7 +134,7 @@ } public: - StringSorter(cmList::SortConfiguration const& config) + StringSorter(cmList::SortConfiguration config) : Filters{ this->GetCompareFilter(config.Compare), this->GetCaseFilter(config.Case) } , SortMethod(this->GetComparisonFunction(config.Compare)) @@ -175,7 +175,7 @@ cmList::SortConfiguration::SortConfiguration() = default; -cmList& cmList::sort(SortConfiguration const& cfg) +cmList& cmList::sort(SortConfiguration cfg) { SortConfiguration config{ cfg }; @@ -910,7 +910,7 @@ // compute all indexes std::vector<size_type> idx(indexes.size()); std::transform(indexes.cbegin(), indexes.cend(), idx.begin(), - [this](index_type const& index) -> size_type { + [this](index_type index) -> size_type { return this->ComputeIndex(index); });
diff --git a/Source/cmList.h b/Source/cmList.h index c355910..41b401b 100644 --- a/Source/cmList.h +++ b/Source/cmList.h
@@ -863,7 +863,7 @@ { } }; - cmList& sort(SortConfiguration const& config = SortConfiguration{}); + cmList& sort(SortConfiguration config = SortConfiguration{}); // exception raised on error during transform operations class transform_error : public std::runtime_error
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index e25da96..118b833 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx
@@ -58,7 +58,7 @@ void cmOSXBundleGenerator::CreateFramework( std::string const& targetName, std::string const& outpath, - std::string const& config, cmOSXBundleGenerator::SkipParts const& skipParts) + std::string const& config, cmOSXBundleGenerator::SkipParts skipParts) { if (this->MustSkip()) { return;
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h index bfd9aec..153cbcc 100644 --- a/Source/cmOSXBundleGenerator.h +++ b/Source/cmOSXBundleGenerator.h
@@ -34,7 +34,7 @@ // create a framework at a given root void CreateFramework(std::string const& targetName, std::string const& root, std::string const& config, - SkipParts const& skipParts = SkipParts{}); + SkipParts skipParts = SkipParts{}); // create a cf bundle at a given root void CreateCFBundle(std::string const& targetName, std::string const& root,
diff --git a/Source/cmPackageInfoReader.cxx b/Source/cmPackageInfoReader.cxx index abf5e69..b684897 100644 --- a/Source/cmPackageInfoReader.cxx +++ b/Source/cmPackageInfoReader.cxx
@@ -180,7 +180,7 @@ } // Extract key name from value iterator as string_view. -cm::string_view IterKey(Json::Value::const_iterator const& iter) +cm::string_view IterKey(Json::Value::const_iterator iter) { char const* end; char const* const start = iter.memberName(&end); @@ -719,7 +719,7 @@ Json::Value const& components = this->Data["components"]; for (auto ci = components.begin(), ce = components.end(); ci != ce; ++ci) { - cm::string_view const& name = IterKey(ci); + cm::string_view const name = IterKey(ci); std::string const& type = cmSystemTools::LowerCase((*ci)["type"].asString()); @@ -798,7 +798,7 @@ for (auto ci = components.begin(), ce = components.end(); ci != ce; ++ci) { // Get component name and look up target. - cm::string_view const& name = IterKey(ci); + cm::string_view const name = IterKey(ci); auto const& ti = this->ComponentTargets.find(std::string{ name }); if (ti == this->ComponentTargets.end()) { status.SetError(cmStrCat("component "_s, name, " was not found"_s));
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index f5797c0..6930eb9 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx
@@ -325,8 +325,8 @@ cmQtAutoGenInitializer::cmQtAutoGenInitializer( cmQtAutoGenGlobalInitializer* globalInitializer, - cmGeneratorTarget* genTarget, IntegerVersion const& qtVersion, - bool mocEnabled, bool uicEnabled, bool rccEnabled, bool globalAutogenTarget, + cmGeneratorTarget* genTarget, IntegerVersion qtVersion, bool mocEnabled, + bool uicEnabled, bool rccEnabled, bool globalAutogenTarget, bool globalAutoRccTarget) : GlobalInitializer(globalInitializer) , GenTarget(genTarget)
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index 09015fe..afb3bfa 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h
@@ -93,7 +93,7 @@ cmQtAutoGenInitializer(cmQtAutoGenGlobalInitializer* globalInitializer, cmGeneratorTarget* genTarget, - IntegerVersion const& qtVersion, bool mocEnabled, + IntegerVersion qtVersion, bool mocEnabled, bool uicEnabled, bool rccEnabled, bool globalAutogenTarget, bool globalAutoRccTarget);
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h index f8ea90d..486d1c9 100644 --- a/Source/cmQtAutoGenerator.h +++ b/Source/cmQtAutoGenerator.h
@@ -88,7 +88,7 @@ // -- Info options std::string const& InfoFile() const { return this->InfoFile_; } std::string const& InfoDir() const { return this->InfoDir_; } - cmFileTime const& InfoFileTime() const { return this->InfoFileTime_; } + cmFileTime InfoFileTime() const { return this->InfoFileTime_; } std::string const& InfoConfig() const { return this->InfoConfig_; } std::string const& ExecutableConfig() const {
diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx index 98911c0..769efea 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.cxx +++ b/Source/cmSetSourceFilesPropertiesCommand.cxx
@@ -37,7 +37,7 @@ }; auto isAPropertyKeyword = - [](std::vector<std::string>::const_iterator const& arg_it) { + [](std::vector<std::string>::const_iterator arg_it) { return std::any_of( std::begin(prop_names), std::end(prop_names), [&arg_it](cm::string_view prop_name) { return *arg_it == prop_name; });
diff --git a/Source/cmStandardLevel.h b/Source/cmStandardLevel.h index dbf71b8..1f191a4 100644 --- a/Source/cmStandardLevel.h +++ b/Source/cmStandardLevel.h
@@ -14,7 +14,7 @@ { } size_t Index() const { return index_; } - friend bool operator<(cmStandardLevel const& l, cmStandardLevel const& r) + friend bool operator<(cmStandardLevel l, cmStandardLevel r) { return l.index_ < r.index_; }
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx index 1bb865d..d6690af 100644 --- a/Source/cmStandardLevelResolver.cxx +++ b/Source/cmStandardLevelResolver.cxx
@@ -542,7 +542,7 @@ } std::string cmStandardLevelResolver::GetLevelString( - std::string const& lang, cmStandardLevel const& level) const + std::string const& lang, cmStandardLevel level) const { auto mapping = StandardComputerMapping.find(lang); if (mapping == StandardComputerMapping.end()) {
diff --git a/Source/cmStandardLevelResolver.h b/Source/cmStandardLevelResolver.h index 1543641..242a971 100644 --- a/Source/cmStandardLevelResolver.h +++ b/Source/cmStandardLevelResolver.h
@@ -30,7 +30,7 @@ std::string const& config) const; std::string GetLevelString(std::string const& lang, - cmStandardLevel const& level) const; + cmStandardLevel level) const; bool AddRequiredTargetFeature(cmTarget* target, std::string const& feature, std::string* error = nullptr) const;
diff --git a/Source/cmString.hxx b/Source/cmString.hxx index 3c2b49b..c346230 100644 --- a/Source/cmString.hxx +++ b/Source/cmString.hxx
@@ -87,7 +87,7 @@ template <> struct IntoString<char> : std::true_type { - static std::string into_string(char const& c) { return std::string(1, c); } + static std::string into_string(char c) { return std::string(1, c); } }; /** @@ -142,19 +142,27 @@ template <> struct AsStringView<char> : std::true_type { - static string_view view(char const& s) { return string_view(&s, 1); } + static string_view view( + char const& s) // clazy:exclude=function-args-by-value + { + return string_view(&s, 1); + } }; template <> struct AsStringView<string_view> : std::true_type { - static string_view view(string_view const& s) { return s; } + static string_view view(string_view s) { return s; } }; template <> struct AsStringView<static_string_view> : std::true_type { - static string_view view(static_string_view const& s) { return s; } + static string_view view( + static_string_view const& s) // clazy:exclude=function-args-by-value + { + return s; + } }; template <>
diff --git a/Source/cmStringAlgorithms.cxx b/Source/cmStringAlgorithms.cxx index a64bfc8..df3b7d9 100644 --- a/Source/cmStringAlgorithms.cxx +++ b/Source/cmStringAlgorithms.cxx
@@ -230,7 +230,7 @@ return cmJoinStrings(rng, separator, initial); } -std::string cmJoin(cmStringRange const& rng, cm::string_view separator, +std::string cmJoin(cmStringRange rng, cm::string_view separator, cm::string_view initial) { return cmJoinStrings(rng, separator, initial);
diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h index 3bf6022..314124e 100644 --- a/Source/cmStringAlgorithms.h +++ b/Source/cmStringAlgorithms.h
@@ -126,7 +126,7 @@ std::string cmJoin(std::vector<std::string> const& rng, cm::string_view separator, cm::string_view initial = {}); -std::string cmJoin(cmStringRange const& rng, cm::string_view separator, +std::string cmJoin(cmStringRange rng, cm::string_view separator, cm::string_view initial = {}); enum class cmTokenizerMode
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 4813db5..f11d347 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx
@@ -3322,8 +3322,8 @@ return false; } -static std::string::size_type cmSystemToolsFindRPath( - cm::string_view const& have, cm::string_view const& want) +static std::string::size_type cmSystemToolsFindRPath(cm::string_view have, + cm::string_view want) { std::string::size_type pos = 0; while (pos < have.size()) {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d87fd7c..cbf8b90 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx
@@ -1626,7 +1626,7 @@ } void cmTarget::AddInstallIncludeDirectories(cmTargetExport const& te, - cmStringRange const& incs) + cmStringRange incs) { std::copy( incs.begin(), incs.end(), @@ -2403,8 +2403,7 @@ } } -void cmTarget::FinalizeTargetConfiguration( - cmBTStringRange const& compileDefinitions) +void cmTarget::FinalizeTargetConfiguration(cmBTStringRange compileDefinitions) { if (this->GetType() == cmStateEnums::GLOBAL_TARGET) { return;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 4d75f45..1c2a9b2 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h
@@ -272,7 +272,7 @@ void InsertPrecompileHeader(BT<std::string> const& entry); void AppendBuildInterfaceIncludes(); - void FinalizeTargetConfiguration(cmBTStringRange const& compileDefinitions); + void FinalizeTargetConfiguration(cmBTStringRange compileDefinitions); std::string GetDebugGeneratorExpressions(std::string const& value, cmTargetLinkLibraryType llt) const; @@ -281,7 +281,7 @@ std::set<std::string> const& GetSystemIncludeDirectories() const; void AddInstallIncludeDirectories(cmTargetExport const& te, - cmStringRange const& incs); + cmStringRange incs); cmStringRange GetInstallIncludeDirectoriesEntries( cmTargetExport const& te) const;
diff --git a/Source/cmWindowsRegistry.cxx b/Source/cmWindowsRegistry.cxx index 0a0add3..154e6d9 100644 --- a/Source/cmWindowsRegistry.cxx +++ b/Source/cmWindowsRegistry.cxx
@@ -524,7 +524,7 @@ template <> struct hash<cmWindowsRegistry::View> { - size_t operator()(cmWindowsRegistry::View const& v) const noexcept + size_t operator()(cmWindowsRegistry::View v) const noexcept { return static_cast< typename underlying_type<cmWindowsRegistry::View>::type>(v);
diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h index ba4f763..e15542d 100644 --- a/Source/cmXMLWriter.h +++ b/Source/cmXMLWriter.h
@@ -108,8 +108,7 @@ * Therefore we must assume it is an arbitrary point in time. Instead of this * method, it is recommended to convert it by means of the to_time_t method. */ - static std::time_t SafeContent( - std::chrono::system_clock::time_point const& value) + static std::time_t SafeContent(std::chrono::system_clock::time_point value) { return std::chrono::system_clock::to_time_t(value); }
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 612217a..897be85 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx
@@ -455,8 +455,8 @@ #ifndef CMAKE_BOOTSTRAP void cmake::SetWarningFromPreset(std::string const& name, - cm::optional<bool> const& warning, - cm::optional<bool> const& error) + cm::optional<bool> warning, + cm::optional<bool> error) { if (warning) { if (*warning) {
diff --git a/Source/cmake.h b/Source/cmake.h index 6d464de..c859beb 100644 --- a/Source/cmake.h +++ b/Source/cmake.h
@@ -388,8 +388,8 @@ #ifndef CMAKE_BOOTSTRAP void SetWarningFromPreset(std::string const& name, - cm::optional<bool> const& warning, - cm::optional<bool> const& error); + cm::optional<bool> warning, + cm::optional<bool> error); void ProcessPresetVariables(); void PrintPresetVariables(); void ProcessPresetEnvironment();
diff --git a/Tests/CMakeLib/testCommon.h b/Tests/CMakeLib/testCommon.h index b7379d5..78c6f24 100644 --- a/Tests/CMakeLib/testCommon.h +++ b/Tests/CMakeLib/testCommon.h
@@ -29,7 +29,7 @@ namespace { -inline int runTests(std::initializer_list<std::function<bool()>> const& tests, +inline int runTests(std::initializer_list<std::function<bool()>> tests, bool const fail_fast = true) { int result = 0;
diff --git a/Tests/CMakeLib/testDebuggerAdapter.cxx b/Tests/CMakeLib/testDebuggerAdapter.cxx index c5ad8b3..cc7c71a 100644 --- a/Tests/CMakeLib/testDebuggerAdapter.cxx +++ b/Tests/CMakeLib/testDebuggerAdapter.cxx
@@ -83,16 +83,13 @@ auto connection = std::make_shared<DebuggerLocalConnection>(); std::unique_ptr<dap::Session> client = dap::Session::create(); - client->registerHandler([&](dap::InitializedEvent const& e) { - (void)e; + client->registerHandler([&](dap::InitializedEvent /*unused*/) { initializedEventReceivedPromise.set_value(true); }); - client->registerHandler([&](dap::ExitedEvent const& e) { - (void)e; + client->registerHandler([&](dap::ExitedEvent /*unused*/) { exitedEventReceivedPromise.set_value(true); }); - client->registerHandler([&](dap::TerminatedEvent const& e) { - (void)e; + client->registerHandler([&](dap::TerminatedEvent const& /*unused*/) { terminatedEventReceivedPromise.set_value(true); }); client->registerHandler([&](dap::ThreadEvent const& e) {
diff --git a/Tests/CMakeLib/testDebuggerAdapterPipe.cxx b/Tests/CMakeLib/testDebuggerAdapterPipe.cxx index 15dc32b..d7c4134 100644 --- a/Tests/CMakeLib/testDebuggerAdapterPipe.cxx +++ b/Tests/CMakeLib/testDebuggerAdapterPipe.cxx
@@ -76,16 +76,13 @@ #endif std::unique_ptr<dap::Session> client = dap::Session::create(); - client->registerHandler([&](dap::InitializedEvent const& e) { - (void)e; + client->registerHandler([&](dap::InitializedEvent /*unused*/) { initializedEventReceivedPromise.set_value(true); }); - client->registerHandler([&](dap::ExitedEvent const& e) { - (void)e; + client->registerHandler([&](dap::ExitedEvent /*unused*/) { exitedEventReceivedPromise.set_value(true); }); - client->registerHandler([&](dap::TerminatedEvent const& e) { - (void)e; + client->registerHandler([&](dap::TerminatedEvent const& /*unused*/) { terminatedEventReceivedPromise.set_value(true); }); client->registerHandler([&](dap::ThreadEvent const& e) {