[vcpkg] add support for FreeBSD (#4917)

* [vcpkg] add support for FreeBSD

* [x64-freebsd] Remove triplet because it is not currently in the set of supported triplets
This commit is contained in:
ivysnow 2019-01-08 08:03:35 +08:00 committed by Robert Schumacher
parent a20ac0957a
commit 2d63525a15
6 changed files with 31 additions and 1 deletions

View File

@ -123,6 +123,8 @@ fetchTool()
os="linux"
elif [ "$UNAME" = "Darwin" ]; then
os="osx"
elif [ "$UNAME" = "FreeBSD" ]; then
os="freebsd"
else
echo "Unknown uname: $UNAME"
return 1

View File

@ -170,6 +170,8 @@ function(vcpkg_configure_cmake)
list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/android.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/osx.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/freebsd.cmake")
endif()
list(APPEND _csc_OPTIONS

View File

@ -123,6 +123,8 @@ function(vcpkg_find_acquire_program VAR)
set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-freebsd")
else()
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux")
endif()

View File

@ -21,6 +21,13 @@
<sha512>ee9eded0c72e06ef99554f09553d40842478700ca6f07319c28247f1d45301708c703c65ad617cf618833257bacc3b9f63a54b32288bfb619d38758669dcd20f</sha512>
<archiveName>cmake-3.12.4-Linux-x86_64.tar.gz</archiveName>
</tool>
<tool name="cmake" os="freebsd">
<version>3.12.4</version>
<exeRelativePath>cmake-3.12.4-FreeBSD-x86_64/bin/cmake</exeRelativePath>
<url>https://github.com/ivysnow/CMake/releases/download/v3.12.4/cmake-3.12.4-FreeBSD-x86_64.tar.gz</url>
<sha512>b5aeb2de36f3c29757c9404e33756da88580ddfa07f29079c7f275ae0d6d018fdfe3f55d54d1403f38e359865cf93436e084c6b1ea91f26c88bc01dde3793479</sha512>
<archiveName>cmake-3.12.4-FreeBSD-x86_64.tar.gz</archiveName>
</tool>
<tool name="git" os="windows">
<version>2.20.0</version>
<exeRelativePath>cmd\git.exe</exeRelativePath>
@ -40,6 +47,12 @@
<url></url>
<sha512></sha512>
</tool>
<tool name="git" os="freebsd">
<version>2.7.4</version>
<exeRelativePath></exeRelativePath>
<url></url>
<sha512></sha512>
</tool>
<tool name="vswhere" os="windows">
<version>2.4.1</version>
<exeRelativePath>vswhere.exe</exeRelativePath>
@ -94,4 +107,11 @@
<sha512>acadfb286eb7d93676629701917fa0c3c39f36daa068c169e4a098c29f97380d1ea95abfd42b04798ff118fd9dc93fdb250fcda36086bac20bc5506354214fc3</sha512>
<archiveName>ninja-mac-1.8.2.zip</archiveName>
</tool>
<tool name="ninja" os="freebsd">
<version>1.8.2</version>
<exeRelativePath>ninja</exeRelativePath>
<url>https://github.com/ivysnow/ninja/releases/download/v1.8.2/ninja-freebsd.zip</url>
<sha512>56a55ae9a6b5dfad4f28f9fe9b8114f1475c999d2f07fff7efa7375f987e74b498e9b63c41fc6c577756f15f3a1459c6d5d367902de3bedebdf9a9fd49089a86</sha512>
<archiveName>ninja-freebsd-1.8.2.zip</archiveName>
</tool>
</tools>

View File

@ -220,6 +220,8 @@ namespace vcpkg::Metrics
"OSX",
#elif defined(__linux__)
"Linux",
#elif defined(__FreeBSD__)
"FreeBSD",
#elif defined(__unix__)
"Unix",
#else

View File

@ -52,11 +52,13 @@ namespace vcpkg
static constexpr StringLiteral OS_STRING = "osx";
#elif defined(__linux__)
static constexpr StringLiteral OS_STRING = "linux";
#elif defined(__FreeBSD__)
static constexpr StringLiteral OS_STRING = "freebsd";
#else
return std::string("operating system is unknown");
#endif
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__)
static const std::string XML_VERSION = "2";
static const fs::path XML_PATH = paths.scripts / "vcpkgTools.xml";
static const std::regex XML_VERSION_REGEX {R"###(<tools[\s]+version="([^"]+)">)###"};