Skip to content

Commit

Permalink
Add long path support
Browse files Browse the repository at this point in the history
  • Loading branch information
frivard-coveo committed Apr 19, 2021
1 parent a539a7c commit b7a5329
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ vcpkg_target_add_warning_options(vcpkg)
if(VCPKG_EMBED_GIT_SHA)
vcpkg_target_add_sourcelink(vcpkg "frivard-coveo" "vcpkg-tool" ${VCPKG_VERSION})
endif()
vcpkg_target_add_manifest(vcpkg) # add support for long paths on Windows (> 260 chars)

# === Target: vcpkg-test ===

Expand Down
10 changes: 10 additions & 0 deletions cmake/utilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,13 @@ function(vcpkg_target_add_sourcelink TARGET repoOwner repoName gitFullSha1)
message(STATUS "SOURCELINK support added, pointing to ${githubBaseUrl}")
endif()
endfunction()

function(vcpkg_target_add_manifest TARGET)
if(MSVC)
configure_file("${CMAKE_SOURCE_DIR}/src/longpathaware.manifest.in"
"${CMAKE_CURRENT_BINARY_DIR}/longpathaware.manifest"
COPYONLY)
target_sources(${TARGET} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/longpathaware.manifest")
message(STATUS "Manifest added to ${TARGET} for long path support")
endif()
endfunction()
7 changes: 7 additions & 0 deletions src/longpathaware.manifest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<longPathAware>true</longPathAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

0 comments on commit b7a5329

Please sign in to comment.