aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-11-30 22:20:06 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-11-30 22:20:06 -0800
commitc8c332c8935e0141f4fcb074b511e77e649f0bd9 (patch)
treeb05e1751c0f3eb74425a95b4d4629edf80fd4ec8
parent03ff483446cc1772415cc1bf2104a9fe99dd5a18 (diff)
parentf174d5561af49cccbfb4d9618be123cf7ee971d6 (diff)
downloadvcpkg-c8c332c8935e0141f4fcb074b511e77e649f0bd9.tar.gz
vcpkg-c8c332c8935e0141f4fcb074b511e77e649f0bd9.zip
Merge branch 'master' of https://github.com/Microsoft/vcpkg
-rw-r--r--ports/libsodium/portfile.cmake19
-rw-r--r--scripts/bootstrap.ps12
-rw-r--r--scripts/findAnyMSBuildWithCppPlatformToolset.ps15
-rw-r--r--toolsrc/src/vcpkg/base/system.cpp1
-rw-r--r--toolsrc/src/vcpkg/vcpkgpaths.cpp64
5 files changed, 67 insertions, 24 deletions
diff --git a/ports/libsodium/portfile.cmake b/ports/libsodium/portfile.cmake
index 4e6cd6be7..c781fb1fb 100644
--- a/ports/libsodium/portfile.cmake
+++ b/ports/libsodium/portfile.cmake
@@ -37,19 +37,22 @@ file(INSTALL
DESTINATION ${CURRENT_PACKAGES_DIR}/include/sodium
)
-file(INSTALL
- ${SOURCE_PATH}/Build/${LIBSODIUM_RELEASE_CONFIGURATION}/${BUILD_ARCH}/libsodium.dll
- DESTINATION ${CURRENT_PACKAGES_DIR}/bin
-)
+if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ file(INSTALL
+ ${SOURCE_PATH}/Build/${LIBSODIUM_RELEASE_CONFIGURATION}/${BUILD_ARCH}/libsodium.dll
+ DESTINATION ${CURRENT_PACKAGES_DIR}/bin
+ )
+ file(INSTALL
+ ${SOURCE_PATH}/Build/${LIBSODIUM_DEBUG_CONFIGURATION}/${BUILD_ARCH}/libsodium.dll
+ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
+ )
+endif()
+
file(INSTALL
${SOURCE_PATH}/Build/${LIBSODIUM_RELEASE_CONFIGURATION}/${BUILD_ARCH}/libsodium.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)
file(INSTALL
- ${SOURCE_PATH}/Build/${LIBSODIUM_DEBUG_CONFIGURATION}/${BUILD_ARCH}/libsodium.dll
- DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
-)
-file(INSTALL
${SOURCE_PATH}/Build/${LIBSODIUM_DEBUG_CONFIGURATION}/${BUILD_ARCH}/libsodium.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1
index ca7b1a0ce..3f40a2ead 100644
--- a/scripts/bootstrap.ps1
+++ b/scripts/bootstrap.ps1
@@ -46,7 +46,7 @@ try
& $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$windowsSDK /m dirs.proj
if ($LASTEXITCODE -ne 0)
{
- Write-Error "Building vcpkg.exe failed. Please ensure you have installed the Desktop C++ workload and the Windows SDK for Desktop C++."
+ Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++."
return
}
diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1
index e58b58c04..46ba767b9 100644
--- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1
+++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1
@@ -8,6 +8,11 @@ $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash
$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
$VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1
+if ($VisualStudioInstallationInstances -eq $null)
+{
+ throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed."
+}
+
Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstallationInstances))"
foreach ($instanceCandidateWithEOL in $VisualStudioInstallationInstances)
{
diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp
index e3d3ad292..8dd73c32f 100644
--- a/toolsrc/src/vcpkg/base/system.cpp
+++ b/toolsrc/src/vcpkg/base/system.cpp
@@ -202,6 +202,7 @@ namespace vcpkg::System
env_cstr.append(Strings::to_utf16(NEW_PATH));
env_cstr.push_back(L'\0');
+ env_cstr.append(L"VSLANG=1033\0");
STARTUPINFOW startup_info;
memset(&startup_info, 0, sizeof(STARTUPINFOW));
diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp
index d5763921e..324ca29d1 100644
--- a/toolsrc/src/vcpkg/vcpkgpaths.cpp
+++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp
@@ -280,7 +280,6 @@ namespace vcpkg
const std::vector<std::string>& VcpkgPaths::get_available_triplets() const
{
return this->available_triplets.get_lazy([this]() -> std::vector<std::string> {
-
std::vector<std::string> output;
for (auto&& path : this->get_filesystem().get_files_non_recursive(this->triplets))
{
@@ -384,6 +383,7 @@ namespace vcpkg
std::vector<fs::path> paths_examined;
std::vector<Toolset> found_toolsets;
+ std::vector<Toolset> excluded_toolsets;
const std::vector<VisualStudioInstance> vs_instances = get_visual_studio_instances(paths);
const bool v140_is_available = Util::find_if(vs_instances, [&](const VisualStudioInstance& vs_instance) {
@@ -440,17 +440,28 @@ namespace vcpkg
paths_examined.push_back(dumpbin_path);
if (fs.exists(dumpbin_path))
{
- found_toolsets.push_back(Toolset{
- vs_instance.root_path, dumpbin_path, vcvarsall_bat, {}, V_141, supported_architectures});
+ const Toolset v141toolset = Toolset{
+ vs_instance.root_path, dumpbin_path, vcvarsall_bat, {}, V_141, supported_architectures};
+
+ auto english_language_pack = dumpbin_path.parent_path() / "1033";
+
+ if (!fs.exists(english_language_pack))
+ {
+ excluded_toolsets.push_back(v141toolset);
+ break;
+ }
+
+ found_toolsets.push_back(v141toolset);
if (v140_is_available)
{
- found_toolsets.push_back(Toolset{vs_instance.root_path,
- dumpbin_path,
- vcvarsall_bat,
- {"-vcvars_ver=14.0"},
- V_140,
- supported_architectures});
+ const Toolset v140toolset = Toolset{vs_instance.root_path,
+ dumpbin_path,
+ vcvarsall_bat,
+ {"-vcvars_ver=14.0"},
+ V_140,
+ supported_architectures};
+ found_toolsets.push_back(v140toolset);
}
break;
@@ -487,17 +498,39 @@ namespace vcpkg
if (fs.exists(vs_dumpbin_exe))
{
- found_toolsets.push_back({vs_instance.root_path,
- vs_dumpbin_exe,
- vcvarsall_bat,
- {},
- major_version == "14" ? V_140 : V_120,
- supported_architectures});
+ const Toolset toolset = {vs_instance.root_path,
+ vs_dumpbin_exe,
+ vcvarsall_bat,
+ {},
+ major_version == "14" ? V_140 : V_120,
+ supported_architectures};
+
+ auto english_language_pack = vs_dumpbin_exe.parent_path() / "1033";
+
+ if (!fs.exists(english_language_pack))
+ {
+ excluded_toolsets.push_back(toolset);
+ break;
+ }
+
+ found_toolsets.push_back(toolset);
}
}
}
}
+ if (!excluded_toolsets.empty())
+ {
+ System::println(
+ System::Color::warning,
+ "Warning: The following VS instances are exluded because the English language pack is unavailable.");
+ for (const Toolset& toolset : excluded_toolsets)
+ {
+ System::println(" %s", toolset.visual_studio_root_path.u8string());
+ }
+ System::println(System::Color::warning, "Please install the English language pack.");
+ }
+
if (found_toolsets.empty())
{
System::println(System::Color::error, "Could not locate a complete toolset.");
@@ -575,6 +608,7 @@ namespace vcpkg
vs_root_path.generic_string());
}
+ Checks::check_exit(VCPKG_LINE_INFO, !candidates.empty(), "No suitable Visual Studio instances were found");
return *candidates.front();
}