CMake: Remove LINUX_LOCAL_DEV and symlink required files
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user