aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2021-02-15 12:26:56 -0800
committerGitHub <noreply@github.com>2021-02-15 12:26:56 -0800
commit6166e754fc5ea77805914afb9273eaff3e5136f1 (patch)
treef5aa3212a4e7c202e8872fa5663ba28b2d10ca49 /scripts
parent17c3670b069e57723deddc1645bda547bb77bad5 (diff)
downloadvcpkg-6166e754fc5ea77805914afb9273eaff3e5136f1.tar.gz
vcpkg-6166e754fc5ea77805914afb9273eaff3e5136f1.zip
[scripts-audit] vcpkg_buildpath_length_warning (#16191)
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."
)