diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-08-08 02:58:09 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-08-08 18:25:01 (GMT) |
commit | b334dc84c3ecc85a6e0856bc23278d435d820060 (patch) | |
tree | 94758b9965b4bccf8a2ae96edd6e50676f7a1095 | |
parent | 36bd3d82f8d69710eaba11f3cefc09db1a1904f5 (diff) | |
download | CMake-b334dc84c3ecc85a6e0856bc23278d435d820060.zip CMake-b334dc84c3ecc85a6e0856bc23278d435d820060.tar.gz CMake-b334dc84c3ecc85a6e0856bc23278d435d820060.tar.bz2 |
cmLocalGenerator: always support shortening filenames
-rw-r--r-- | Source/cmLocalGenerator.cxx | 18 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 6 |
2 files changed, 5 insertions, 19 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1a1a454..ffab712 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -25,6 +25,7 @@ #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" +#include "cmCryptoHash.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" #include "cmCustomCommandLines.h" @@ -59,11 +60,6 @@ #include "cmVersion.h" #include "cmake.h" -#if !defined(CMAKE_BOOTSTRAP) -# define CM_LG_ENCODE_OBJECT_NAMES -# include "cmCryptoHash.h" -#endif - #if defined(__HAIKU__) # include <FindDirectory.h> # include <StorageDefs.h> @@ -3698,9 +3694,9 @@ void cmLocalGenerator::GenerateTargetInstallRules( } } -#if defined(CM_LG_ENCODE_OBJECT_NAMES) -static bool cmLocalGeneratorShortenObjectName(std::string& objName, - std::string::size_type max_len) +namespace { +bool cmLocalGeneratorShortenObjectName(std::string& objName, + std::string::size_type max_len) { // Check if the path can be shortened using an md5 sum replacement for // a portion of the path. @@ -3744,7 +3740,7 @@ bool cmLocalGeneratorCheckObjectName(std::string& objName, // already too deep. return false; } -#endif +} std::string& cmLocalGenerator::CreateSafeUniqueObjectFileName( const std::string& sin, std::string const& dir_max) @@ -3794,7 +3790,6 @@ std::string& cmLocalGenerator::CreateSafeUniqueObjectFileName( } while (!done); } -#if defined(CM_LG_ENCODE_OBJECT_NAMES) if (!cmLocalGeneratorCheckObjectName(ssin, dir_max.size(), this->ObjectPathMax)) { // Warn if this is the first time the path has been seen. @@ -3815,9 +3810,6 @@ std::string& cmLocalGenerator::CreateSafeUniqueObjectFileName( this->IssueMessage(MessageType::WARNING, m.str()); } } -#else - (void)dir_max; -#endif // Insert the newly mapped object file name. std::map<std::string, std::string>::value_type e(sin, ssin); diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 3d2e5f6..eddc033 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -701,12 +701,6 @@ private: std::string const& filename_base); }; -#if !defined(CMAKE_BOOTSTRAP) -bool cmLocalGeneratorCheckObjectName(std::string& objName, - std::string::size_type dir_len, - std::string::size_type max_total_len); -#endif - namespace detail { void AddCustomCommandToTarget(cmLocalGenerator& lg, cmCommandOrigin origin, cmTarget* target, cmCustomCommandType type, |