This commit is contained in:
Portal 2026-04-13 03:54:59 -04:00 committed by GitHub
commit 9b92aabec7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 12 deletions

View file

@ -40,12 +40,12 @@ if(CMAKE_HOST_WIN32)
elseif(CMAKE_HOST_UNIX) elseif(CMAKE_HOST_UNIX)
execute_process( execute_process(
COMMAND rsync -av ${COPY_SOURCE} "${COPY_DEST}/" COMMAND cp -av "${COPY_SOURCE}/" "${COPY_DEST}/"
RESULT_VARIABLE rs RESULT_VARIABLE cp
) )
if(rs GREATER 0) # Any non-zero exit code indicates an error if(cp GREATER 0) # Any non-zero exit code indicates an error
message(FATAL_ERROR "rsync failed (exit code ${rs})") message(FATAL_ERROR "cp failed (exit code ${cp})")
endif() endif()
else() else()
message(FATAL_ERROR "Unsupported host platform for asset copying.") message(FATAL_ERROR "Unsupported host platform for asset copying.")

View file

@ -46,24 +46,25 @@ if(CMAKE_HOST_WIN32)
message(FATAL_ERROR "robocopy failed (exit code ${rc})") message(FATAL_ERROR "robocopy failed (exit code ${rc})")
endif() endif()
elseif(CMAKE_HOST_UNIX) elseif(CMAKE_HOST_UNIX)
set(rsync_args -av) set(tar_args)
foreach(pattern IN LISTS EXCLUDE_FILES) foreach(pattern IN LISTS EXCLUDE_FILES)
list(APPEND rsync_args "--exclude=${pattern}") list(APPEND tar_args "--exclude=${pattern}")
endforeach() endforeach()
foreach(pattern IN LISTS EXCLUDE_FOLDERS) foreach(pattern IN LISTS EXCLUDE_FOLDERS)
list(APPEND rsync_args "--exclude=${pattern}") list(APPEND tar_args "--exclude=${pattern}")
endforeach() endforeach()
# Trailing slashes ensure rsync copies contents, not the directory itself # Trailing slashes ensure tar copies contents, not the directory itself
execute_process( execute_process(
COMMAND rsync ${rsync_args} "${COPY_SOURCE}/" "${COPY_DEST}/" COMMAND tar ${tar_args} -cf - -C "${COPY_SOURCE}/" .
RESULT_VARIABLE rs COMMAND tar -xvf - -C "${COPY_DEST}/"
RESULT_VARIABLE tr
) )
if(rs GREATER 0) # Any non-zero exit code indicates an error if(tr GREATER 0) # Any non-zero exit code indicates an error
message(FATAL_ERROR "rsync failed (exit code ${rs})") message(FATAL_ERROR "tar failed (exit code ${tr})")
endif() endif()
else() else()
message(FATAL_ERROR "Unsupported host platform for asset copying.") message(FATAL_ERROR "Unsupported host platform for asset copying.")