aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_integration.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2016-09-21 15:41:30 -0700
committerRobert Schumacher <roschuma@microsoft.com>2016-09-21 15:41:30 -0700
commit81d64262983b9f47d61ec184d029184616d52f34 (patch)
treee44a69db4cd879f341ef42f5141d79cd76200e66 /toolsrc/src/commands_integration.cpp
parent7f310150d6908ee9ebcff353080e90effffa2285 (diff)
downloadvcpkg-81d64262983b9f47d61ec184d029184616d52f34.tar.gz
vcpkg-81d64262983b9f47d61ec184d029184616d52f34.zip
[vcpkg] Place VS user-wide integration into a C++ specific folder instead of for all projects.
This avoids a bug where the IDE would erroneously add x86, x64, and ARM architectures to C# projects.
Diffstat (limited to 'toolsrc/src/commands_integration.cpp')
-rw-r--r--toolsrc/src/commands_integration.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp
index 0b1aa3696..178d40e83 100644
--- a/toolsrc/src/commands_integration.cpp
+++ b/toolsrc/src/commands_integration.cpp
@@ -6,6 +6,7 @@
#include <fstream>
#include <iostream>
#include <regex>
+#include <array>
#include "vcpkg_Environment.h"
#include "vcpkg_Checks.h"
#include "vcpkg_System.h"
@@ -13,8 +14,11 @@
namespace vcpkg
{
- static const fs::path old_system_wide_targets_file = "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets";
- static const fs::path system_wide_targets_file = "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.system.targets";
+ static const std::array<fs::path, 2> old_system_target_files = {
+ "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets",
+ "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.system.targets"
+ };
+ static const fs::path system_wide_targets_file = "C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/V140/ImportBefore/Default/vcpkg.system.props";
static std::string create_appdata_targets_shortcut(const std::string& target_path) noexcept
{
@@ -145,6 +149,7 @@ namespace vcpkg
static void integrate_install(const vcpkg_paths& paths)
{
// TODO: This block of code should eventually be removed
+ for (auto&& old_system_wide_targets_file : old_system_target_files)
{
if (fs::exists(old_system_wide_targets_file))
{