We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cbbc35 commit ea3724aCopy full SHA for ea3724a
cmake/CPM.cmake
@@ -215,6 +215,16 @@ endfunction()
215
# We will be able to use a shorter path with very high probability, but in the (rare) event that the
216
# first couple characters collide, we will check longer and longer substrings.
217
function(cpm_get_shortest_hash source_cache_dir origin_hash short_hash_output_var)
218
+ # for compatibility with caches populated by a previous version of CPM, check if a directory using
219
+ # the full hash already exists
220
+ if(EXISTS "${source_cache_dir}/${origin_hash}")
221
+ set(${short_hash_output_var}
222
+ "${origin_hash}"
223
+ PARENT_SCOPE
224
+ )
225
+ return()
226
+ endif()
227
+
228
foreach(len RANGE 4 40 4)
229
string(SUBSTRING "${origin_hash}" 0 ${len} short_hash)
230
set(hash_lock ${source_cache_dir}/${short_hash}.lock)
0 commit comments