aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-03-27 13:23:30 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-03-27 17:54:16 -0700
commitc814c9b8ac883aa42930e1f48660145fd4234fe6 (patch)
tree64df184079990b497554c697c482de400bbe1008
parent45d31162c25e168c46d9dd0f3f00e49edf625f21 (diff)
downloadvcpkg-c814c9b8ac883aa42930e1f48660145fd4234fe6.tar.gz
vcpkg-c814c9b8ac883aa42930e1f48660145fd4234fe6.zip
[vcpkgTools.xml] Restructre os-specific info
-rw-r--r--scripts/vcpkgTools.xml20
-rw-r--r--toolsrc/src/vcpkg/vcpkgpaths.cpp16
2 files changed, 22 insertions, 14 deletions
diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml
index 9c78e92d9..5df2de7ad 100644
--- a/scripts/vcpkgTools.xml
+++ b/scripts/vcpkgTools.xml
@@ -6,12 +6,20 @@
<url>https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip</url>
<sha256>f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6</sha256>
<archiveRelativePath>cmake-3.10.2-win32-x86.zip</archiveRelativePath>
- <exeRelativePath os="osx">cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake</exeRelativePath>
- <url os="osx">https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz</url>
- <archiveRelativePath os="osx">cmake-3.10.2-Darwin-x86_64.tar.gz</archiveRelativePath>
- <exeRelativePath os="linux">cmake-3.10.2-Linux-x86_64/bin/cmake</exeRelativePath>
- <url os="linux">https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz</url>
- <archiveRelativePath os="linux">cmake-3.10.2-Linux-x86_64.tar.gz</archiveRelativePath>
+ </tool>
+ <tool name="cmake" os="osx">
+ <requiredVersion>3.10.2</requiredVersion>
+ <exeRelativePath>cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake</exeRelativePath>
+ <url>https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz</url>
+ <sha256>e748eb7698f8e2783c2eea9ab81eebf66da0238bbf8e8fa722a67a38f2110718</sha256>
+ <archiveRelativePath>cmake-3.10.2-Darwin-x86_64.tar.gz</archiveRelativePath>
+ </tool>
+ <tool name="cmake" os="linux">
+ <requiredVersion>3.10.2</requiredVersion>
+ <exeRelativePath>cmake-3.10.2-Linux-x86_64/bin/cmake</exeRelativePath>
+ <url>https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz</url>
+ <sha256>7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea</sha256>
+ <archiveRelativePath>cmake-3.10.2-Linux-x86_64.tar.gz</archiveRelativePath>
</tool>
<tool name="git">
<requiredVersion>2.16.2</requiredVersion>
diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp
index 9b331d7fc..feacda026 100644
--- a/toolsrc/src/vcpkg/vcpkgpaths.cpp
+++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp
@@ -46,9 +46,9 @@ namespace vcpkg
#if defined(_WIN32)
static constexpr StringLiteral OS_STRING = "";
#elif defined(__APPLE__)
- static constexpr StringLiteral OS_STRING = " os=\"osx\"";
+ static constexpr StringLiteral OS_STRING = R"(os="osx")";
#else // assume linux
- static constexpr StringLiteral OS_STRING = " os=\"linux\"";
+ static constexpr StringLiteral OS_STRING = R"(os="linux")";
#endif
static const fs::path XML_PATH = paths.scripts / "vcpkgTools.xml";
@@ -72,15 +72,15 @@ namespace vcpkg
};
static const std::string XML = paths.get_filesystem().read_contents(XML_PATH).value_or_exit(VCPKG_LINE_INFO);
- static const std::regex VERSION_REGEX{
- Strings::format(R"###(<requiredVersion>([\s\S]*?)</requiredVersion>)###", tool)};
+ static const std::regex VERSION_REGEX{R"###(<requiredVersion>([\s\S]*?)</requiredVersion>)###"};
static const std::regex EXE_RELATIVE_PATH_REGEX{
- Strings::format(R"###(<exeRelativePath%s>([\s\S]*?)</exeRelativePath>)###", OS_STRING)};
+ Strings::format(R"###(<exeRelativePath>([\s\S]*?)</exeRelativePath>)###")};
static const std::regex ARCHIVE_RELATIVE_PATH_REGEX{
- Strings::format(R"###(<archiveRelativePath%s>([\s\S]*?)</archiveRelativePath>)###", OS_STRING)};
- static const std::regex URL_REGEX{Strings::format(R"###(<url%s>([\s\S]*?)</url>)###", OS_STRING)};
+ Strings::format(R"###(<archiveRelativePath>([\s\S]*?)</archiveRelativePath>)###")};
+ static const std::regex URL_REGEX{Strings::format(R"###(<url>([\s\S]*?)</url>)###")};
- const std::regex tool_regex{Strings::format(R"###(<tool[\s]+name="%s">([\s\S]*?)</tool>)###", tool)};
+ const std::regex tool_regex{
+ Strings::format(R"###(<tool[\s]+name="%s"[\s]+%s>([\s\S]*?)</tool>)###", tool, OS_STRING)};
std::smatch match_tool;
const bool has_match_tool = std::regex_search(XML.cbegin(), XML.cend(), match_tool, tool_regex);