Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for long paths on Windows for yarpidl_thrift #3057

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions cmake/YarpInstallationHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,28 @@ macro(YARP_INSTALL _what)
endif()

endmacro()


# yarp_enable_windows_longpath_support(<target>)
#
# This function enables longpath support on Windows on a given target by adding the appropriate
# manifest as documented in https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation .
#
# On non-Windows platforms, this functions does not do anything
function(YARP_ENABLE_WINDOWS_LONGPATH_SUPPORT _target)
if(MSVC)
set(yewls_manifest_filename "${_target}_longpath.manifest")
set(yewls_manifest_output "${CMAKE_CURRENT_BINARY_DIR}/${yewls_manifest_filename}")

set(yewls_manifest_contents [=[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</windowsSettings>
</application>
</assembly>]=])
file(GENERATE OUTPUT "${yewls_manifest_output}" CONTENT "${yewls_manifest_contents}")
target_sources(${_target} PRIVATE "${yewls_manifest_output}")
endif()
endfunction()
3 changes: 3 additions & 0 deletions doc/release/yarp_3_9/yarpidl_thrift_windows_longpath.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#### `yarpidl_thrift`

* Add support for `yarpidl_thrift` to manipulate paths longer than 260 characters on Windows.
2 changes: 2 additions & 0 deletions src/yarpidl_thrift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ target_sources(yarpidl_thrift
${yarpidl_thrift_YARP_SRCS}
)

yarp_enable_windows_longpath_support(yarpidl_thrift)

install(
TARGETS yarpidl_thrift
EXPORT YARP_idl_tools
Expand Down