diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-09-19 18:41:28 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-09-19 18:41:28 -0700 |
| commit | 48ec8f295061ae02d8e22dde60c445c99baac79e (patch) | |
| tree | 2c2a587c32344277bbfd81eb5670b11c524fa885 | |
| parent | 64a7483a4a4c9d176896ec7aec08a6acef4ea8f3 (diff) | |
| parent | 1faf5c7d289f5b693fbcaa98af8b41833e6a5a04 (diff) | |
| download | vcpkg-48ec8f295061ae02d8e22dde60c445c99baac79e.tar.gz vcpkg-48ec8f295061ae02d8e22dde60c445c99baac79e.zip | |
Merge remote-tracking branch 'origin/master' into dev/roschuma/upgrades
| -rw-r--r-- | ports/azure-storage-cpp/CONTROL | 2 | ||||
| -rw-r--r-- | ports/azure-storage-cpp/portfile.cmake | 4 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/commands.h | 6 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/visualstudio.h | 2 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/commands.cpp | 1 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/commands.xvsinstances.cpp | 33 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/visualstudio.cpp | 51 | ||||
| -rw-r--r-- | toolsrc/vcpkglib/vcpkglib.vcxproj | 1 | ||||
| -rw-r--r-- | toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 3 |
9 files changed, 86 insertions, 17 deletions
diff --git a/ports/azure-storage-cpp/CONTROL b/ports/azure-storage-cpp/CONTROL index 9c4f027d2..cde95570e 100644 --- a/ports/azure-storage-cpp/CONTROL +++ b/ports/azure-storage-cpp/CONTROL @@ -1,5 +1,5 @@ Source: azure-storage-cpp -Version: 5.1.0 +Version: 5.1.1 Build-Depends: cpprestsdk, atlmfc (windows), boost-log (!windows&!uwp), boost-locale (!windows&!uwp), libxml2 (!windows&!uwp), libuuid (!windows&!uwp) Description: Microsoft Azure Storage Client SDK for C++ A client library for working with Microsoft Azure storage services including blobs, files, tables, and queues. This client library enables working with the Microsoft Azure storage services which include the blob service for storing binary and text data, the file service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client. Microsoft Azure Storage team's blog - http://blogs.msdn.com/b/windowsazurestorage/ diff --git a/ports/azure-storage-cpp/portfile.cmake b/ports/azure-storage-cpp/portfile.cmake index 474856e57..07affc756 100644 --- a/ports/azure-storage-cpp/portfile.cmake +++ b/ports/azure-storage-cpp/portfile.cmake @@ -7,8 +7,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-storage-cpp - REF v5.1.0 - SHA512 a072b43482133bcc16d2da013ede2a29cb530ddeb0cdd38ed1f08d2a67fe7c6e2c7b0c5bb5c69b5c5b21de62bddfc20e12766618e6c6721d1221a00d435c1d51 + REF v5.1.1 + SHA512 e5983d767681cf82a68af3c983a83515a2a7a3b5bf2ffbadcd2992dbcdf213bb322f8d0c4369a4c729ac7536e3e0f52e44cde012cbe1f9464df3ad901f635b6a HEAD_REF master PATCHES ${CMAKE_CURRENT_LIST_DIR}/pplx-do-while.patch diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 1858a320f..fd7d832b3 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -119,6 +119,12 @@ namespace vcpkg::Commands void perform_and_exit(const VcpkgCmdArguments& args); } + namespace X_VSInstances + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + namespace Hash { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); diff --git a/toolsrc/include/vcpkg/visualstudio.h b/toolsrc/include/vcpkg/visualstudio.h index b93b145d9..cd99db352 100644 --- a/toolsrc/include/vcpkg/visualstudio.h +++ b/toolsrc/include/vcpkg/visualstudio.h @@ -6,6 +6,8 @@ namespace vcpkg::VisualStudio
{
+ std::vector<std::string> get_visual_studio_instances(const VcpkgPaths& paths);
+
std::vector<Toolset> find_toolset_instances_preferred_first(const VcpkgPaths& paths);
}
diff --git a/toolsrc/src/vcpkg/commands.cpp b/toolsrc/src/vcpkg/commands.cpp index 7204b6e78..db265514f 100644 --- a/toolsrc/src/vcpkg/commands.cpp +++ b/toolsrc/src/vcpkg/commands.cpp @@ -46,6 +46,7 @@ namespace vcpkg::Commands {"autocomplete", &Autocomplete::perform_and_exit}, {"hash", &Hash::perform_and_exit}, {"fetch", &Fetch::perform_and_exit}, + {"x-vsinstances", &X_VSInstances::perform_and_exit}, }; return t; } diff --git a/toolsrc/src/vcpkg/commands.xvsinstances.cpp b/toolsrc/src/vcpkg/commands.xvsinstances.cpp new file mode 100644 index 000000000..d748b6b2f --- /dev/null +++ b/toolsrc/src/vcpkg/commands.xvsinstances.cpp @@ -0,0 +1,33 @@ +#include "pch.h"
+
+#include <vcpkg/commands.h>
+#include <vcpkg/help.h>
+#include <vcpkg/visualstudio.h>
+
+namespace vcpkg::Commands::X_VSInstances
+{
+ const CommandStructure COMMAND_STRUCTURE = {
+ Help::create_example_string("x-vsinstances"),
+ 0,
+ 0,
+ {{}, {}},
+ nullptr,
+ };
+
+ void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
+ {
+#if defined(_WIN32)
+ const ParsedArguments parsed_args = args.parse_arguments(COMMAND_STRUCTURE);
+
+ const auto instances = vcpkg::VisualStudio::get_visual_studio_instances(paths);
+ for (const std::string& instance : instances)
+ {
+ System::println(instance);
+ }
+
+ Checks::exit_success(VCPKG_LINE_INFO);
+#else
+ Checks::exit_with_message(VCPKG_LINE_INFO, "This command is not supported on non-windows platforms.");
+#endif
+ }
+}
diff --git a/toolsrc/src/vcpkg/visualstudio.cpp b/toolsrc/src/vcpkg/visualstudio.cpp index 9480a11bf..e3656a7d2 100644 --- a/toolsrc/src/vcpkg/visualstudio.cpp +++ b/toolsrc/src/vcpkg/visualstudio.cpp @@ -22,6 +22,17 @@ namespace vcpkg::VisualStudio LEGACY }; + static std::string release_type_to_string(const ReleaseType& release_type) + { + switch (release_type) + { + case ReleaseType::STABLE: return "STABLE"; + case ReleaseType::PRERELEASE: return "PRERELEASE"; + case ReleaseType::LEGACY: return "LEGACY"; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + static bool preferred_first_comparator(const VisualStudioInstance& left, const VisualStudioInstance& right) { const auto get_preference_weight = [](const ReleaseType& type) -> int { @@ -51,10 +62,15 @@ namespace vcpkg::VisualStudio std::string version; ReleaseType release_type; + std::string to_string() const + { + return Strings::format("%s, %s, %s", root_path.u8string(), version, release_type_to_string(release_type)); + } + std::string major_version() const { return version.substr(0, 2); } }; - static std::vector<VisualStudioInstance> get_visual_studio_instances(const VcpkgPaths& paths) + static std::vector<VisualStudioInstance> get_visual_studio_instances_internal(const VcpkgPaths& paths) { const auto& fs = paths.get_filesystem(); std::vector<VisualStudioInstance> instances; @@ -66,7 +82,7 @@ namespace vcpkg::VisualStudio if (fs.exists(vswhere_exe)) { const auto code_and_output = System::cmd_execute_and_capture_output( - Strings::format(R"("%s" -prerelease -legacy -products * -format xml)", vswhere_exe.u8string())); + Strings::format(R"("%s" -all -prerelease -legacy -products * -format xml)", vswhere_exe.u8string())); Checks::check_exit(VCPKG_LINE_INFO, code_and_output.exit_code == 0, "Running vswhere.exe failed with message:\n%s", @@ -114,9 +130,9 @@ namespace vcpkg::VisualStudio { // We want lexically_normal(), but it is not available // Correct root path might be 2 or 3 levels up, depending on if the path has trailing backslash. Try both. - auto common7_tools = fs::path{*path_as_string}; - append_if_has_cl(fs::path{*path_as_string}.parent_path().parent_path()); - append_if_has_cl(fs::path{*path_as_string}.parent_path().parent_path().parent_path()); + auto common7_tools = fs::path {*path_as_string}; + append_if_has_cl(fs::path {*path_as_string}.parent_path().parent_path()); + append_if_has_cl(fs::path {*path_as_string}.parent_path().parent_path().parent_path()); } // VS2015 instance from Program Files @@ -125,6 +141,13 @@ namespace vcpkg::VisualStudio return instances; } + std::vector<std::string> get_visual_studio_instances(const VcpkgPaths& paths) + { + std::vector<VisualStudioInstance> sorted {get_visual_studio_instances_internal(paths)}; + std::sort(sorted.begin(), sorted.end(), VisualStudioInstance::preferred_first_comparator); + return Util::fmap(sorted, [](const VisualStudioInstance& instance) { return instance.to_string(); }); + } + std::vector<Toolset> find_toolset_instances_preferred_first(const VcpkgPaths& paths) { using CPU = System::CPUArchitecture; @@ -137,8 +160,8 @@ namespace vcpkg::VisualStudio std::vector<Toolset> found_toolsets; std::vector<Toolset> excluded_toolsets; - const SortedVector<VisualStudioInstance> sorted{get_visual_studio_instances(paths), - VisualStudioInstance::preferred_first_comparator}; + const SortedVector<VisualStudioInstance> sorted {get_visual_studio_instances_internal(paths), + VisualStudioInstance::preferred_first_comparator}; const bool v140_is_available = Util::find_if(sorted, [&](const VisualStudioInstance& vs_instance) { return vs_instance.major_version() == "14"; @@ -194,7 +217,7 @@ namespace vcpkg::VisualStudio paths_examined.push_back(dumpbin_path); if (fs.exists(dumpbin_path)) { - const Toolset v141_toolset{ + const Toolset v141_toolset { vs_instance.root_path, dumpbin_path, vcvarsall_bat, {}, V_141, supported_architectures}; const auto english_language_pack = dumpbin_path.parent_path() / "1033"; @@ -209,12 +232,12 @@ namespace vcpkg::VisualStudio if (v140_is_available) { - const Toolset v140_toolset{vs_instance.root_path, - dumpbin_path, - vcvarsall_bat, - {"-vcvars_ver=14.0"}, - V_140, - supported_architectures}; + const Toolset v140_toolset {vs_instance.root_path, + dumpbin_path, + vcvarsall_bat, + {"-vcvars_ver=14.0"}, + V_140, + supported_architectures}; found_toolsets.push_back(v140_toolset); } diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index abfe8a242..315c48174 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -233,6 +233,7 @@ <ClCompile Include="..\src\vcpkg\commands.search.cpp" />
<ClCompile Include="..\src\vcpkg\commands.upgrade.cpp" />
<ClCompile Include="..\src\vcpkg\commands.version.cpp" />
+ <ClCompile Include="..\src\vcpkg\commands.xvsinstances.cpp" />
<ClCompile Include="..\src\vcpkg\dependencies.cpp" />
<ClCompile Include="..\src\vcpkg\export.cpp" />
<ClCompile Include="..\src\vcpkg\globalstate.cpp" />
diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 42493d623..3e0ccd885 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -213,6 +213,9 @@ <ClCompile Include="..\src\vcpkg\base\downloads.cpp">
<Filter>Source Files\vcpkg\base</Filter>
</ClCompile>
+ <ClCompile Include="..\src\vcpkg\commands.xvsinstances.cpp">
+ <Filter>Source Files\vcpkg</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\pch.h">
|
