aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_buildpath_length_warning.cmake13
1 files changed, 8 insertions, 5 deletions
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."
)