Explorar o código

ExternalData: use `file(CREATE_LINK)`

This avoids spawning a new CMake command which isn't necessary.
Ben Boeckel %!s(int64=4) %!d(string=hai) anos
pai
achega
b6c022eaa2
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Modules/ExternalData.cmake

+ 2 - 1
Modules/ExternalData.cmake

@@ -941,7 +941,8 @@ function(_ExternalData_link_or_copy src dst)
         file(RELATIVE_PATH tgt "${dst_dir}" "${src}")
       endif()
     endif()
-    execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink "${tgt}" "${tmp}" RESULT_VARIABLE result)
+    # Create link (falling back to copying if there's a problem).
+    file(CREATE_LINK "${tgt}" "${tmp}" RESULT result COPY_ON_ERROR SYMBOLIC)
   else()
     # Create a copy.
     file(COPY_FILE "${src}" "${tmp}" RESULT result)