diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 056b21cac7..f0bfb9839f 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -2,12 +2,15 @@ vcpkgDisableMetrics="OFF" vcpkgUseSystem=false +vcpkgAllowAppleClang=OFF for var in "$@" do if [ "$var" = "-disableMetrics" -o "$var" = "--disableMetrics" ]; then vcpkgDisableMetrics="ON" elif [ "$var" = "-useSystemBinaries" -o "$var" = "--useSystemBinaries" ]; then vcpkgUseSystem=true + elif [ "$var" = "-allowAppleClang" -o "$var" = "--allowAppleClang" ]; then + vcpkgAllowAppleClang=ON elif [ "$var" = "-help" -o "$var" = "--help" ]; then echo "Usage: ./bootstrap-vcpkg.sh [options]" echo @@ -15,6 +18,7 @@ do 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" + echo " -allowAppleClang Set VCPKG_ALLOW_APPLE_CLANG to build vcpkg in apple with clang anyway" exit 1 else echo "Unknown argument $var. Use '-help' for help." @@ -234,7 +238,7 @@ buildDir="$vcpkgRootDir/toolsrc/build.rel" rm -rf "$buildDir" mkdir -p "$buildDir" -(cd "$buildDir" && CXX=$CXX "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DDEFINE_DISABLE_METRICS=$vcpkgDisableMetrics") || exit 1 +(cd "$buildDir" && CXX=$CXX "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DDEFINE_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 (cd "$buildDir" && "$cmakeExe" --build .) || exit 1 rm -rf "$vcpkgRootDir/vcpkg" diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt index 706162bd35..e0c4cdd86d 100644 --- a/toolsrc/CMakeLists.txt +++ b/toolsrc/CMakeLists.txt @@ -1,7 +1,9 @@ cmake_minimum_required(VERSION 3.3) + project(vcpkg C CXX) OPTION(DEFINE_DISABLE_METRICS "Option for disabling metrics" OFF) +OPTION(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang" OFF) if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") set(GCC 1) @@ -11,7 +13,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") "Building the vcpkg tool requires support for the C++ Filesystem TS. Apple clang versions 9 and below do not have support for it. Please install gcc6 or newer from homebrew (brew install gcc6). -If you would like to try anyway, set VCPKG_ALLOW_APPLE_CLANG.") +If you would like to try anyway, pass --allowAppleClang to bootstrap.sh.") else() set(CLANG 1) endif()