java-topology/defects/cmake-0007/patch/cmake-0007-dlldirs-unordered-set.patch

24 lines
1 KiB
Diff

# UNDF: UNDF-2026-000001070
# UNDF:
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -4499,11 +4499,13 @@ static const struct TargetRuntimeDllDirsNode : public TargetRuntimeDllsBaseNode
std::vector<std::string> dlls = CollectDlls(parameters, eval, content);
std::vector<std::string> dllDirs;
+ std::unordered_set<std::string> dllDirsSet;
for (std::string const& dll : dlls) {
std::string directory = cmSystemTools::GetFilenamePath(dll);
- if (std::find(dllDirs.begin(), dllDirs.end(), directory) ==
- dllDirs.end()) {
+ if (dllDirsSet.insert(directory).second) {
dllDirs.push_back(directory);
}
}
return cmList::to_string(dllDirs);
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1,6 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file LICENSE.rst or https://cmake.org/licensing for details. */
#include "cmGeneratorExpressionNode.h"
+#include <unordered_set>