aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-04-17 10:56:27 -0700
committerGitHub <noreply@github.com>2020-04-17 10:56:27 -0700
commit12d75a13acb74ab8e4b2d9f91d41209813345d0c (patch)
tree494911cb3290cd083a2a53b09b30901596987006 /scripts
parentb12256a4af4e77e1ae87bbf76c1c3a654cdcd1a2 (diff)
downloadvcpkg-12d75a13acb74ab8e4b2d9f91d41209813345d0c.tar.gz
vcpkg-12d75a13acb74ab8e4b2d9f91d41209813345d0c.zip
[vcpkg] Fix build scripts on openSUSE and g++9 (#10867)
The existing code did not correctly pass `CXX` to cmake.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bootstrap.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 722ffe5c2..9f6560e30 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -200,9 +200,7 @@ fetchTool()
selectCXX()
{
if [ "x$CXX" = "x" ]; then
- if which g++ >/dev/null 2>&1; then
- CXX=g++
- elif which g++-9 >/dev/null 2>&1; then
+ if which g++-9 >/dev/null 2>&1; then
CXX=g++-9
elif which g++-8 >/dev/null 2>&1; then
CXX=g++-8
@@ -210,6 +208,8 @@ selectCXX()
CXX=g++-7
elif which g++-6 >/dev/null 2>&1; then
CXX=g++-6
+ elif which g++ >/dev/null 2>&1; then
+ CXX=g++
fi
# If we can't find g++, allow CMake to do the look-up
fi
@@ -236,13 +236,12 @@ else
fi
# Do the build
-srcDir="$vcpkgRootDir/toolsrc"
-buildDir="$srcDir/build.rel"
+buildDir="$vcpkgRootDir/toolsrc/build.rel"
rm -rf "$buildDir"
mkdir -p "$buildDir"
-("$cmakeExe" -B "$buildDir" -S "$srcDir" -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_WARNINGS_AS_ERRORS=OFF" "-DVCPKG_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1
-("$cmakeExe" --build "$buildDir") || exit 1
+(cd "$buildDir" && CXX="$CXX" "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1
+(cd "$buildDir" && "$cmakeExe" --build .) || exit 1
rm -rf "$vcpkgRootDir/vcpkg"
cp "$buildDir/vcpkg" "$vcpkgRootDir/"