diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-12-11 10:15:44 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-12-12 09:19:37 -0800 |
| commit | 828cedb755d1ef1616e4e134bf1c6ef1ee2ae389 (patch) | |
| tree | 5fbd302dc0b30b6129680acbd43eaf2ee9bb532f /scripts | |
| parent | cf7e2f3906f78dcb89f320a642428b54c00e4e0b (diff) | |
| download | vcpkg-828cedb755d1ef1616e4e134bf1c6ef1ee2ae389.tar.gz vcpkg-828cedb755d1ef1616e4e134bf1c6ef1ee2ae389.zip | |
[vcpkg] Add support for muslc, static crt linkage, and forcing the system binaries for cmake and ninja
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/bootstrap.sh | 37 | ||||
| -rw-r--r-- | scripts/toolchains/linux.cmake | 4 |
2 files changed, 31 insertions, 10 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 5de0998c1..4bb428668 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -1,12 +1,23 @@ #!/bin/sh vcpkgDisableMetrics="OFF" +vcpkgUseSystem=false for var in "$@" do - if [ "$var" = "-disableMetrics" ]; then + if [ "$var" = "-disableMetrics" -o "$var" = "--disableMetrics" ]; then vcpkgDisableMetrics="ON" + elif [ "$var" = "-useSystemBinaries" -o "$var" = "--useSystemBinaries" ]; then + vcpkgUseSystem=true + 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" + exit 1 else - echo "Unknown argument $var" + echo "Unknown argument $var. Use '-help' for help." exit 1 fi done @@ -191,13 +202,13 @@ selectCXX() if [ "$gccversion" -lt "6" ]; then echo "CXX ($CXX) is too old; please install a newer compiler such as g++-7." echo "On Ubuntu try the following:" - echo "sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y" - echo "sudo apt-get update -y" - echo "sudo apt-get install g++-7 -y" + echo " sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y" + echo " sudo apt-get update -y" + echo " sudo apt-get install g++-7 -y" echo "On CentOS try the following:" - echo "sudo yum install centos-release-scl" - echo "sudo yum install devtoolset-7" - echo "scl enable devtoolset-7 bash" + echo " sudo yum install centos-release-scl" + echo " sudo yum install devtoolset-7" + echo " scl enable devtoolset-7 bash" return 1 fi @@ -206,8 +217,14 @@ selectCXX() # Preparation UNAME="$(uname)" -fetchTool "cmake" "$UNAME" cmakeExe || exit 1 -fetchTool "ninja" "$UNAME" ninjaExe || exit 1 + +if $vcpkgUseSystem; then + cmakeExe="cmake" + ninjaExe="ninja" +else + fetchTool "cmake" "$UNAME" cmakeExe || exit 1 + fetchTool "ninja" "$UNAME" ninjaExe || exit 1 +fi selectCXX CXX || exit 1 # Do the build diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index 6bfb57621..b9cbc0ff3 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -16,5 +16,9 @@ if(NOT _CMAKE_IN_TRY_COMPILE) string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ if(VCPKG_CRT_LINKAGE STREQUAL "static")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT "-static ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-static ")
+ endif()
endif()
endif()
|
