diff options
| -rw-r--r-- | docs/maintainers/vcpkg_buildpath_length_warning.md | 7 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_buildpath_length_warning.cmake | 13 |
2 files changed, 13 insertions, 7 deletions
diff --git a/docs/maintainers/vcpkg_buildpath_length_warning.md b/docs/maintainers/vcpkg_buildpath_length_warning.md index 77c1776b2..fdc7adeda 100644 --- a/docs/maintainers/vcpkg_buildpath_length_warning.md +++ b/docs/maintainers/vcpkg_buildpath_length_warning.md @@ -2,10 +2,13 @@ Warns the user if their vcpkg installation path might be too long for the package they're installing. -## Usage ```cmake -vcpkg_buildpath_length_warning(13) +vcpkg_buildpath_length_warning(<N>) ``` +`vcpkg_buildpath_length_warning` warns the user if the number of bytes in the +path to `buildtrees` is bigger than `N`. Note that this is simply a warning, +and isn't relied on for correctness. + ## Source [scripts/cmake/vcpkg_buildpath_length_warning.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_buildpath_length_warning.cmake) diff --git a/scripts/cmake/vcpkg_buildpath_length_warning.cmake b/scripts/cmake/vcpkg_buildpath_length_warning.cmake index c3cc6d0f6..7b4032e7c 100644 --- a/scripts/cmake/vcpkg_buildpath_length_warning.cmake +++ b/scripts/cmake/vcpkg_buildpath_length_warning.cmake @@ -3,15 +3,18 @@ Warns the user if their vcpkg installation path might be too long for the package they're installing.
-## Usage
```cmake
-vcpkg_buildpath_length_warning(13)
+vcpkg_buildpath_length_warning(<N>)
```
+
+`vcpkg_buildpath_length_warning` warns the user if the number of bytes in the
+path to `buildtrees` is bigger than `N`. Note that this is simply a warning,
+and isn't relied on for correctness.
#]===]
-function(vcpkg_buildpath_length_warning WARNING_LENGTH)
- string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH)
- if(BUILDTREES_PATH_LENGTH GREATER ${WARNING_LENGTH} AND CMAKE_HOST_WIN32)
+function(vcpkg_buildpath_length_warning warning_length)
+ string(LENGTH "${CURRENT_BUILDTREES_DIR}" buildtrees_path_length)
+ if(buildtrees_path_length GREATER warning_length AND CMAKE_HOST_WIN32)
message(WARNING "${PORT}'s buildsystem uses very long paths and may fail on your system.\n"
"We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command."
)
|
