From 6166e754fc5ea77805914afb9273eaff3e5136f1 Mon Sep 17 00:00:00 2001 From: nicole mazzuca Date: Mon, 15 Feb 2021 12:26:56 -0800 Subject: [scripts-audit] vcpkg_buildpath_length_warning (#16191) --- scripts/cmake/vcpkg_buildpath_length_warning.cmake | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts') 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() ``` + +`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." ) -- cgit v1.2.3