diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-08-08 01:12:08 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-08-08 17:22:13 (GMT) |
commit | ec5f1c489a43456a97f849456e3c81b45bda05dd (patch) | |
tree | 2ad734f8a8ab8721c0539f1c4c6269d10b73db8b /Source/cmIncludeGuardCommand.cxx | |
parent | 6b21d2bc9bbe241252b5ad30b7a8bb850518638c (diff) | |
download | CMake-ec5f1c489a43456a97f849456e3c81b45bda05dd.zip CMake-ec5f1c489a43456a97f849456e3c81b45bda05dd.tar.gz CMake-ec5f1c489a43456a97f849456e3c81b45bda05dd.tar.bz2 |
cmCryptoHash: prefer to cmSystemTools::ComputeStringMD5
The latter call is no longer post-bootstrap only since 596439b1bb
(cmCustomCommandGenerator: Add option to transform depfile, 2020-10-05)
via !5325. Convert callers to just use `cmCryptoHash` directly and
remove the bootstrap guard.
Diffstat (limited to 'Source/cmIncludeGuardCommand.cxx')
-rw-r--r-- | Source/cmIncludeGuardCommand.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Source/cmIncludeGuardCommand.cxx b/Source/cmIncludeGuardCommand.cxx index e0a6958..2b0e03c 100644 --- a/Source/cmIncludeGuardCommand.cxx +++ b/Source/cmIncludeGuardCommand.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIncludeGuardCommand.h" +#include "cmCryptoHash.h" #include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmStateDirectory.h" #include "cmStateSnapshot.h" -#include "cmSystemTools.h" +#include "cmStringAlgorithms.h" #include "cmValue.h" #include "cmake.h" @@ -21,14 +22,8 @@ enum IncludeGuardScope std::string GetIncludeGuardVariableName(std::string const& filePath) { - std::string result = "__INCGUARD_"; -#ifndef CMAKE_BOOTSTRAP - result += cmSystemTools::ComputeStringMD5(filePath); -#else - result += cmSystemTools::MakeCidentifier(filePath); -#endif - result += "__"; - return result; + cmCryptoHash hasher(cmCryptoHash::AlgoMD5); + return cmStrCat("__INCGUARD_", hasher.HashString(filePath), "__"); } bool CheckIncludeGuardIsSet(cmMakefile* mf, std::string const& includeGuardVar) |