2018-03-27 03:03:26 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-04-20 02:24:05 +02:00
|
|
|
# Find .vcpkg-root, which indicates the root of this repo
|
|
|
|
vcpkgRootDir=$(X= cd -- "$(dirname -- "$0")" && pwd -P)
|
|
|
|
while [ "$vcpkgRootDir" != "/" ] && ! [ -e "$vcpkgRootDir/.vcpkg-root" ]; do
|
|
|
|
vcpkgRootDir="$(dirname "$vcpkgRootDir")"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Argument parsing
|
2018-06-11 17:01:13 -07:00
|
|
|
vcpkgDisableMetrics="OFF"
|
2018-12-11 10:15:44 -08:00
|
|
|
vcpkgUseSystem=false
|
2019-10-07 19:35:13 +02:00
|
|
|
vcpkgAllowAppleClang=false
|
2020-05-14 12:49:31 -07:00
|
|
|
vcpkgBuildTests="OFF"
|
2018-06-08 18:01:35 -07:00
|
|
|
for var in "$@"
|
|
|
|
do
|
2018-12-11 10:15:44 -08:00
|
|
|
if [ "$var" = "-disableMetrics" -o "$var" = "--disableMetrics" ]; then
|
2018-06-11 17:01:13 -07:00
|
|
|
vcpkgDisableMetrics="ON"
|
2018-12-11 10:15:44 -08:00
|
|
|
elif [ "$var" = "-useSystemBinaries" -o "$var" = "--useSystemBinaries" ]; then
|
|
|
|
vcpkgUseSystem=true
|
2019-04-11 12:02:03 +04:30
|
|
|
elif [ "$var" = "-allowAppleClang" -o "$var" = "--allowAppleClang" ]; then
|
2019-10-07 19:35:13 +02:00
|
|
|
vcpkgAllowAppleClang=true
|
2020-05-14 12:49:31 -07:00
|
|
|
elif [ "$var" = "-buildTests" ]; then
|
|
|
|
vcpkgBuildTests="ON"
|
2018-12-11 10:15:44 -08:00
|
|
|
elif [ "$var" = "-help" -o "$var" = "--help" ]; then
|
|
|
|
echo "Usage: ./bootstrap-vcpkg.sh [options]"
|
|
|
|
echo
|
|
|
|
echo "Options:"
|
|
|
|
echo " -help Display usage help"
|
|
|
|
echo " -disableMetrics Do not build metrics reporting into the executable"
|
|
|
|
echo " -useSystemBinaries Force use of the system utilities for building vcpkg"
|
2019-04-11 12:02:03 +04:30
|
|
|
echo " -allowAppleClang Set VCPKG_ALLOW_APPLE_CLANG to build vcpkg in apple with clang anyway"
|
2018-12-11 10:15:44 -08:00
|
|
|
exit 1
|
2018-06-08 18:01:35 -07:00
|
|
|
else
|
2018-12-11 10:15:44 -08:00
|
|
|
echo "Unknown argument $var. Use '-help' for help."
|
2018-06-08 18:01:35 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2020-05-19 15:22:44 -07:00
|
|
|
# Enable using this entry point on windows from git bash by redirecting to the .bat file.
|
|
|
|
unixName=$(uname -s | sed 's/MINGW.*_NT.*/MINGW_NT/')
|
|
|
|
if [ "$unixName" = "MINGW_NT" ]; then
|
|
|
|
if [ "$vcpkgDisableMetrics" = "ON" ]; then
|
|
|
|
args="-disableMetrics"
|
|
|
|
else
|
|
|
|
args=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
vcpkgRootDir=$(cygpath -aw "$vcpkgRootDir")
|
|
|
|
cmd "/C $vcpkgRootDir\\bootstrap-vcpkg.bat $args" || exit 1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-12-11 11:48:41 -08:00
|
|
|
if [ -z ${VCPKG_DOWNLOADS+x} ]; then
|
|
|
|
downloadsDir="$vcpkgRootDir/downloads"
|
|
|
|
else
|
|
|
|
downloadsDir="$VCPKG_DOWNLOADS"
|
|
|
|
if [ ! -d "$VCPKG_DOWNLOADS" ]; then
|
|
|
|
echo "VCPKG_DOWNLOADS was set to '$VCPKG_DOWNLOADS', but that was not a directory."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
2018-03-27 03:03:26 -07:00
|
|
|
|
|
|
|
extractStringBetweenDelimiters()
|
|
|
|
{
|
|
|
|
input=$1;leftDelim=$2;rightDelim=$3
|
|
|
|
output="${input##*$leftDelim}"
|
|
|
|
output="${output%%$rightDelim*}"
|
|
|
|
echo "$output"
|
|
|
|
}
|
|
|
|
|
|
|
|
vcpkgCheckRepoTool()
|
|
|
|
{
|
|
|
|
__tool=$1
|
|
|
|
if ! command -v "$__tool" >/dev/null 2>&1 ; then
|
|
|
|
echo "Could not find $__tool. Please install it (and other dependencies) with:"
|
2020-12-03 23:12:40 +01:00
|
|
|
echo "sudo apt-get install curl zip unzip tar"
|
2018-03-27 03:03:26 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-09-05 10:45:48 -07:00
|
|
|
vcpkgCheckBuildTool()
|
|
|
|
{
|
|
|
|
__tool=$1
|
|
|
|
if ! command -v "$__tool" >/dev/null 2>&1 ; then
|
|
|
|
echo "Could not find $__tool. Please install it (and other dependencies) with:"
|
|
|
|
echo "sudo apt-get install cmake ninja-build"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-03-27 03:03:26 -07:00
|
|
|
vcpkgCheckEqualFileHash()
|
|
|
|
{
|
|
|
|
url=$1; filePath=$2; expectedHash=$3
|
|
|
|
|
2018-04-25 22:23:45 -07:00
|
|
|
if command -v "sha512sum" >/dev/null 2>&1 ; then
|
|
|
|
actualHash=$(sha512sum "$filePath")
|
|
|
|
else
|
|
|
|
# sha512sum is not available by default on osx
|
|
|
|
# shasum is not available by default on Fedora
|
|
|
|
actualHash=$(shasum -a 512 "$filePath")
|
2018-04-26 07:38:45 +07:00
|
|
|
fi
|
|
|
|
|
2018-03-27 03:03:26 -07:00
|
|
|
actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word
|
|
|
|
|
|
|
|
if ! [ "$expectedHash" = "$actualHash" ]; then
|
|
|
|
echo ""
|
|
|
|
echo "File does not have expected hash:"
|
|
|
|
echo " url: [ $url ]"
|
|
|
|
echo " File path: [ $downloadPath ]"
|
|
|
|
echo " Expected hash: [ $sha512 ]"
|
|
|
|
echo " Actual hash: [ $actualHash ]"
|
2019-03-19 16:32:24 -07:00
|
|
|
exit 1
|
2018-03-27 03:03:26 -07:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
vcpkgDownloadFile()
|
|
|
|
{
|
|
|
|
url=$1; downloadPath=$2 sha512=$3
|
|
|
|
vcpkgCheckRepoTool "curl"
|
|
|
|
rm -rf "$downloadPath.part"
|
2020-05-07 14:20:14 -07:00
|
|
|
curl -L $url --tlsv1.2 --create-dirs --retry 3 --output "$downloadPath.part" || exit 1
|
2018-03-27 03:03:26 -07:00
|
|
|
|
|
|
|
vcpkgCheckEqualFileHash $url "$downloadPath.part" $sha512
|
|
|
|
mv "$downloadPath.part" "$downloadPath"
|
|
|
|
}
|
|
|
|
|
|
|
|
vcpkgExtractArchive()
|
|
|
|
{
|
|
|
|
archive=$1; toPath=$2
|
|
|
|
rm -rf "$toPath" "$toPath.partial"
|
|
|
|
mkdir -p "$toPath.partial"
|
|
|
|
|
|
|
|
archiveType="${archive##*.}"
|
|
|
|
if [ "$archiveType" = "zip" ]; then
|
|
|
|
vcpkgCheckRepoTool "unzip"
|
|
|
|
$(cd "$toPath.partial" && unzip -qqo "$archive")
|
|
|
|
else
|
|
|
|
vcpkgCheckRepoTool "tar"
|
|
|
|
$(cd "$toPath.partial" && tar xzf "$archive")
|
|
|
|
fi
|
|
|
|
mv "$toPath.partial" "$toPath"
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchTool()
|
|
|
|
{
|
|
|
|
tool=$1; UNAME=$2; __output=$3
|
|
|
|
|
|
|
|
if [ "$tool" = "" ]; then
|
|
|
|
echo "No tool name provided"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$UNAME" = "Linux" ]; then
|
|
|
|
os="linux"
|
|
|
|
elif [ "$UNAME" = "Darwin" ]; then
|
|
|
|
os="osx"
|
2019-01-08 08:03:35 +08:00
|
|
|
elif [ "$UNAME" = "FreeBSD" ]; then
|
|
|
|
os="freebsd"
|
2018-03-27 03:03:26 -07:00
|
|
|
else
|
|
|
|
echo "Unknown uname: $UNAME"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2018-05-16 04:48:26 +00:00
|
|
|
xmlFileAsString=`cat "$vcpkgRootDir/scripts/vcpkgTools.xml"`
|
2018-03-27 03:03:26 -07:00
|
|
|
toolRegexStart="<tool name=\"$tool\" os=\"$os\">"
|
|
|
|
toolData="$(extractStringBetweenDelimiters "$xmlFileAsString" "$toolRegexStart" "</tool>")"
|
|
|
|
if [ "$toolData" = "" ]; then
|
|
|
|
echo "Unknown tool: $tool"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
version="$(extractStringBetweenDelimiters "$toolData" "<version>" "</version>")"
|
|
|
|
|
|
|
|
toolPath="$downloadsDir/tools/$tool-$version-$os"
|
|
|
|
|
|
|
|
exeRelativePath="$(extractStringBetweenDelimiters "$toolData" "<exeRelativePath>" "</exeRelativePath>")"
|
|
|
|
exePath="$toolPath/$exeRelativePath"
|
|
|
|
|
|
|
|
if [ -e "$exePath" ]; then
|
|
|
|
eval $__output="'$exePath'"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
isArchive=true
|
|
|
|
if [ $isArchive = true ]; then
|
|
|
|
archiveName="$(extractStringBetweenDelimiters "$toolData" "<archiveName>" "</archiveName>")"
|
|
|
|
downloadPath="$downloadsDir/$archiveName"
|
|
|
|
else
|
|
|
|
echo "Non-archives not supported yet"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
url="$(extractStringBetweenDelimiters "$toolData" "<url>" "</url>")"
|
|
|
|
sha512="$(extractStringBetweenDelimiters "$toolData" "<sha512>" "</sha512>")"
|
|
|
|
if ! [ -e "$downloadPath" ]; then
|
|
|
|
echo "Downloading $tool..."
|
|
|
|
vcpkgDownloadFile $url "$downloadPath" $sha512
|
|
|
|
echo "Downloading $tool... done."
|
|
|
|
else
|
|
|
|
vcpkgCheckEqualFileHash $url "$downloadPath" $sha512
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $isArchive = true ]; then
|
|
|
|
echo "Extracting $tool..."
|
|
|
|
vcpkgExtractArchive "$downloadPath" "$toolPath"
|
|
|
|
echo "Extracting $tool... done."
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! [ -e "$exePath" ]; then
|
|
|
|
echo "Could not detect or download $tool"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
eval $__output="'$exePath'"
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
selectCXX()
|
|
|
|
{
|
|
|
|
if [ "x$CXX" = "x" ]; then
|
2020-09-28 03:53:24 +03:00
|
|
|
if which g++-10 >/dev/null 2>&1; then
|
|
|
|
CXX=g++-10
|
|
|
|
elif which g++-9 >/dev/null 2>&1; then
|
2019-05-13 11:43:24 -07:00
|
|
|
CXX=g++-9
|
|
|
|
elif which g++-8 >/dev/null 2>&1; then
|
2018-05-15 20:57:10 -07:00
|
|
|
CXX=g++-8
|
|
|
|
elif which g++-7 >/dev/null 2>&1; then
|
2018-03-27 03:03:26 -07:00
|
|
|
CXX=g++-7
|
|
|
|
elif which g++-6 >/dev/null 2>&1; then
|
|
|
|
CXX=g++-6
|
2020-04-17 10:56:27 -07:00
|
|
|
elif which g++ >/dev/null 2>&1; then
|
|
|
|
CXX=g++
|
2018-03-27 03:03:26 -07:00
|
|
|
fi
|
[vcpkg] Clean up CMake build system (#10834)
There are quite a few changes to the CMake build system packaged up into
one set here:
* Added `toolsrc/cmake/utilities.cmake`, which contains the following:
* `vcpkg_detect_compiler` -- get the name of the C++ compiler, as one
of {gcc, clang, msvc}
* `vcpkg_detect_standard_library` -- get the name of the standard
library we're linking to, as one of {libstdc++, libc++, msvc-stl}
* `vcpkg_detect_std_filesystem` -- figure out how to link and call
into C++17's filesystem; whether one needs to link to `stdc++fs` or
`c++fs`, and whether to use `<filesystem>` or
`<experimental/filesystem>`.
* Added a `VCPKG_WARNINGS_AS_ERRORS`, split off from
`VCPKG_DEVELOPMENT_WARNINGS`, which allows one to use the development
warnings without passing -Werror
* Rename `DEFINE_DISABLE_METRICS` to `VCPKG_DISABLE_METRICS` -- the
former will now print a deprecation message and set the latter.
* Now, print a deprecation message on `WERROR`; it doesn't do anything
since the behavior it requested is now the default.
* Pass `-std=c++17` if the compiler allows it, instead of `-std=c++1z`
* Do some code movement
* Pass `USE_STD_FILESYSTEM` if possible, instead of only on minGW
* Renamed to `VCPKG_USE_STD_FILESYSTEM`
Additionally, we now pass `/W4` in Debug mode on x86 in the Visual
Studio build system; this brings it in line with the CMake build system,
and the x64 Visual Studio build system.
And finally, we make some minor code changes to support compiling in
VCPKG_DEVELOPMENT_WARNINGS mode.
2020-04-14 22:08:50 -07:00
|
|
|
# If we can't find g++, allow CMake to do the look-up
|
2018-03-27 03:03:26 -07:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Preparation
|
|
|
|
UNAME="$(uname)"
|
2020-09-05 10:45:48 -07:00
|
|
|
ARCH="$(uname -m)"
|
|
|
|
|
2021-01-22 19:37:26 +01:00
|
|
|
# Force using system utilities for building vcpkg if host arch is arm, arm64, s390x, or ppc64le.
|
|
|
|
if [ "$ARCH" = "armv7l" -o "$ARCH" = "aarch64" -o "$ARCH" = "s390x" -o "$ARCH" = "ppc64le" ]; then
|
2020-09-05 10:45:48 -07:00
|
|
|
vcpkgUseSystem=true
|
|
|
|
fi
|
2018-12-11 10:15:44 -08:00
|
|
|
|
2020-11-23 18:43:23 +01:00
|
|
|
if [ "$UNAME" = "OpenBSD" ]; then
|
|
|
|
vcpkgUseSystem=true
|
|
|
|
|
|
|
|
if [ -z "$CXX" ]; then
|
|
|
|
CXX=/usr/bin/clang++
|
|
|
|
fi
|
|
|
|
if [ -z "$CC" ]; then
|
|
|
|
CC=/usr/bin/clang
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-12-11 10:15:44 -08:00
|
|
|
if $vcpkgUseSystem; then
|
|
|
|
cmakeExe="cmake"
|
|
|
|
ninjaExe="ninja"
|
2020-09-05 10:45:48 -07:00
|
|
|
vcpkgCheckBuildTool "$cmakeExe"
|
|
|
|
vcpkgCheckBuildTool "$ninjaExe"
|
2018-12-11 10:15:44 -08:00
|
|
|
else
|
|
|
|
fetchTool "cmake" "$UNAME" cmakeExe || exit 1
|
|
|
|
fetchTool "ninja" "$UNAME" ninjaExe || exit 1
|
|
|
|
fi
|
2019-10-07 19:35:13 +02:00
|
|
|
if [ "$os" = "osx" ]; then
|
|
|
|
if [ "$vcpkgAllowAppleClang" = "true" ] ; then
|
2019-10-14 18:04:05 -05:00
|
|
|
CXX=clang++
|
2019-10-07 19:35:13 +02:00
|
|
|
else
|
[vcpkg] Clean up CMake build system (#10834)
There are quite a few changes to the CMake build system packaged up into
one set here:
* Added `toolsrc/cmake/utilities.cmake`, which contains the following:
* `vcpkg_detect_compiler` -- get the name of the C++ compiler, as one
of {gcc, clang, msvc}
* `vcpkg_detect_standard_library` -- get the name of the standard
library we're linking to, as one of {libstdc++, libc++, msvc-stl}
* `vcpkg_detect_std_filesystem` -- figure out how to link and call
into C++17's filesystem; whether one needs to link to `stdc++fs` or
`c++fs`, and whether to use `<filesystem>` or
`<experimental/filesystem>`.
* Added a `VCPKG_WARNINGS_AS_ERRORS`, split off from
`VCPKG_DEVELOPMENT_WARNINGS`, which allows one to use the development
warnings without passing -Werror
* Rename `DEFINE_DISABLE_METRICS` to `VCPKG_DISABLE_METRICS` -- the
former will now print a deprecation message and set the latter.
* Now, print a deprecation message on `WERROR`; it doesn't do anything
since the behavior it requested is now the default.
* Pass `-std=c++17` if the compiler allows it, instead of `-std=c++1z`
* Do some code movement
* Pass `USE_STD_FILESYSTEM` if possible, instead of only on minGW
* Renamed to `VCPKG_USE_STD_FILESYSTEM`
Additionally, we now pass `/W4` in Debug mode on x86 in the Visual
Studio build system; this brings it in line with the CMake build system,
and the x64 Visual Studio build system.
And finally, we make some minor code changes to support compiling in
VCPKG_DEVELOPMENT_WARNINGS mode.
2020-04-14 22:08:50 -07:00
|
|
|
selectCXX
|
2019-10-07 19:35:13 +02:00
|
|
|
fi
|
|
|
|
else
|
[vcpkg] Clean up CMake build system (#10834)
There are quite a few changes to the CMake build system packaged up into
one set here:
* Added `toolsrc/cmake/utilities.cmake`, which contains the following:
* `vcpkg_detect_compiler` -- get the name of the C++ compiler, as one
of {gcc, clang, msvc}
* `vcpkg_detect_standard_library` -- get the name of the standard
library we're linking to, as one of {libstdc++, libc++, msvc-stl}
* `vcpkg_detect_std_filesystem` -- figure out how to link and call
into C++17's filesystem; whether one needs to link to `stdc++fs` or
`c++fs`, and whether to use `<filesystem>` or
`<experimental/filesystem>`.
* Added a `VCPKG_WARNINGS_AS_ERRORS`, split off from
`VCPKG_DEVELOPMENT_WARNINGS`, which allows one to use the development
warnings without passing -Werror
* Rename `DEFINE_DISABLE_METRICS` to `VCPKG_DISABLE_METRICS` -- the
former will now print a deprecation message and set the latter.
* Now, print a deprecation message on `WERROR`; it doesn't do anything
since the behavior it requested is now the default.
* Pass `-std=c++17` if the compiler allows it, instead of `-std=c++1z`
* Do some code movement
* Pass `USE_STD_FILESYSTEM` if possible, instead of only on minGW
* Renamed to `VCPKG_USE_STD_FILESYSTEM`
Additionally, we now pass `/W4` in Debug mode on x86 in the Visual
Studio build system; this brings it in line with the CMake build system,
and the x64 Visual Studio build system.
And finally, we make some minor code changes to support compiling in
VCPKG_DEVELOPMENT_WARNINGS mode.
2020-04-14 22:08:50 -07:00
|
|
|
selectCXX
|
2019-10-07 19:35:13 +02:00
|
|
|
fi
|
2018-03-27 03:03:26 -07:00
|
|
|
|
|
|
|
# Do the build
|
2021-02-26 12:06:44 -08:00
|
|
|
vcpkgToolReleaseTag="2021-02-24-d67989bce1043b98092ac45996a8230a059a2d7e"
|
|
|
|
vcpkgToolReleaseSha="0b0f2cd40aa92556c28e1dfa9f8356313a859fb6acb6c730821a06bd9d554ab1ea0622da4026ea66fb11b9ed4fda1316cc388067d51ff1f09af85d033fe4323d"
|
2021-02-04 10:15:44 -08:00
|
|
|
vcpkgToolReleaseTarball="$vcpkgToolReleaseTag.tar.gz"
|
|
|
|
vcpkgToolUrl="https://github.com/microsoft/vcpkg-tool/archive/$vcpkgToolReleaseTarball"
|
|
|
|
baseBuildDir="$vcpkgRootDir/buildtrees/_vcpkg"
|
|
|
|
buildDir="$baseBuildDir/build"
|
|
|
|
tarballPath="$downloadsDir/$vcpkgToolReleaseTarball"
|
|
|
|
srcBaseDir="$baseBuildDir/src"
|
|
|
|
srcDir="$srcBaseDir/vcpkg-tool-$vcpkgToolReleaseTag"
|
|
|
|
|
|
|
|
if [ -e "$tarballPath" ]; then
|
|
|
|
vcpkgCheckEqualFileHash "$vcpkgToolUrl" "$tarballPath" "$vcpkgToolReleaseSha"
|
|
|
|
else
|
|
|
|
echo "Downloading vcpkg tool sources"
|
|
|
|
vcpkgDownloadFile "$vcpkgToolUrl" "$tarballPath" "$vcpkgToolReleaseSha"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Building vcpkg-tool..."
|
|
|
|
rm -rf "$baseBuildDir"
|
2018-03-27 03:03:26 -07:00
|
|
|
mkdir -p "$buildDir"
|
2021-02-04 10:15:44 -08:00
|
|
|
vcpkgExtractArchive "$tarballPath" "$srcBaseDir"
|
2018-03-27 03:03:26 -07:00
|
|
|
|
2021-02-04 10:15:44 -08:00
|
|
|
(cd "$buildDir" && CXX="$CXX" "$cmakeExe" "$srcDir" -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=$vcpkgBuildTests" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1
|
2020-04-17 10:56:27 -07:00
|
|
|
(cd "$buildDir" && "$cmakeExe" --build .) || exit 1
|
2018-03-27 03:03:26 -07:00
|
|
|
|
|
|
|
rm -rf "$vcpkgRootDir/vcpkg"
|
2018-04-26 02:11:04 +00:00
|
|
|
cp "$buildDir/vcpkg" "$vcpkgRootDir/"
|
2019-11-14 13:12:36 -08:00
|
|
|
|
2021-01-13 14:06:06 -08:00
|
|
|
if [ "$vcpkgDisableMetrics" = "ON" ]; then
|
|
|
|
touch "$vcpkgRootDir/vcpkg.disable-metrics"
|
|
|
|
elif ! [ -f "$vcpkgRootDir/vcpkg.disable-metrics" ]; then
|
|
|
|
# Note that we intentionally leave any existing vcpkg.disable-metrics; once a user has
|
|
|
|
# opted out they should stay opted out.
|
2020-05-29 14:09:03 -07:00
|
|
|
cat <<EOF
|
|
|
|
Telemetry
|
|
|
|
---------
|
|
|
|
vcpkg collects usage data in order to help us improve your experience.
|
|
|
|
The data collected by Microsoft is anonymous.
|
|
|
|
You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics,
|
|
|
|
passing --disable-metrics to vcpkg on the command line,
|
|
|
|
or by setting the VCPKG_DISABLE_METRICS environment variable.
|
|
|
|
|
|
|
|
Read more about vcpkg telemetry at docs/about/privacy.md
|
|
|
|
EOF
|
2020-02-13 18:12:12 -08:00
|
|
|
fi
|