diff options
| author | Joshua Vandaƫle <joshua@vandaele.software> | 2025-12-11 03:29:09 +0100 |
|---|---|---|
| committer | Joshua Vandaƫle <joshua@vandaele.software> | 2026-07-24 03:45:13 +0200 |
| commit | 3d9f46cd64eeedbb7ac92039002d505ca6e594c7 (patch) | |
| tree | 798710c4024e5be3dbddc81f3aea60a625f3b262 /CMake | |
| parent | fa2a250f01be4f58e728d6f3fbb43e1eef56c808 (diff) | |
CMake: Remove LINUX_LOCAL_DEV and symlink required files
Diffstat (limited to 'CMake')
| -rw-r--r-- | CMake/DolphinSymlinkOrCopy.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CMake/DolphinSymlinkOrCopy.cmake b/CMake/DolphinSymlinkOrCopy.cmake new file mode 100644 index 0000000000..dd712cb266 --- /dev/null +++ b/CMake/DolphinSymlinkOrCopy.cmake @@ -0,0 +1,20 @@ +if(NOT DEFINED target OR NOT DEFINED link) + message(FATAL_ERROR "`target` and `link` must be defined") +endif() + +file(CREATE_LINK "${target}" "${link}" RESULT result SYMBOLIC) +if(result EQUAL 0) + return() +endif() + +if(WIN32) + set(hint "On Windows, enable Developer Mode to allow symlinks (https://learn.microsoft.com/windows/advanced-settings/developer-mode).") +endif() +message(WARNING "Symlink failed (${result}). Falling back to copying. ${hint}") + +file(REMOVE_RECURSE "${link}") +if(IS_DIRECTORY "${target}") + file(COPY "${target}/." DESTINATION "${link}") +else() + file(COPY_FILE "${target}" "${link}" ONLY_IF_DIFFERENT) +endif() |
