Skip to content

Commit

Permalink
[vcpkg] Fix vs2015 build (microsoft#12789)
Browse files Browse the repository at this point in the history
* move windows bootstrap directory

* fix paths

* actually fix the build

* fix path
  • Loading branch information
strega-nil authored Aug 7, 2020
1 parent 61c055a commit 40c8aab
Show file tree
Hide file tree
Showing 16 changed files with 582 additions and 887 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ __pycache__/
/packages/
/scripts/buildsystems/tmp/
/toolsrc/build.rel/
/toolsrc/msbuild.x86.debug/
/toolsrc/msbuild.x86.release/
/toolsrc/msbuild.x64.debug/
/toolsrc/msbuild.x64.release/
/toolsrc/windows-bootstrap/msbuild.x86.debug/
/toolsrc/windows-bootstrap/msbuild.x86.release/
/toolsrc/windows-bootstrap/msbuild.x64.debug/
/toolsrc/windows-bootstrap/msbuild.x64.release/
#ignore custom triplets
/triplets/*
#add vcpkg-designed triplets back in
Expand Down
12 changes: 6 additions & 6 deletions scripts/bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root"))
}
Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root - Found"

$vcpkgSourcesPath = "$vcpkgRootDir\toolsrc"
$vcpkgBootstrapPath = "$vcpkgRootDir\toolsrc\windows-bootstrap"

if (!(Test-Path $vcpkgSourcesPath))
if (-not (Test-Path $vcpkgBootstrapPath))
{
Write-Error "Unable to determine vcpkg sources directory. '$vcpkgSourcesPath' does not exist."
Write-Error "Unable to determine vcpkg build directory. '$vcpkgBootstrapPath' does not exist."
throw
}

Expand Down Expand Up @@ -339,7 +339,7 @@ if ($disableMetrics)
}

$platform = "x86"
$vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x86.release"
$vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x86.release"
if($PSVersionTable.PSVersion.Major -le 2)
{
$architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture
Expand All @@ -356,7 +356,7 @@ if ($win64)
}

$platform = "x64"
$vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x64.release"
$vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x64.release"
}

if ($architecture -like "*64*")
Expand All @@ -379,7 +379,7 @@ $arguments = (
"/verbosity:minimal",
"/m",
"/nologo",
"`"$vcpkgSourcesPath\dirs.proj`"") -join " "
"`"$vcpkgBootstrapPath\dirs.proj`"") -join " "

function vcpkgInvokeCommandClean()
{
Expand Down
4 changes: 2 additions & 2 deletions toolsrc/include/vcpkg/base/stringview.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace vcpkg
constexpr const char* begin() const { return m_ptr; }
constexpr const char* end() const { return m_ptr + m_size; }

constexpr std::reverse_iterator<const char*> rbegin() const { return std::make_reverse_iterator(end()); }
constexpr std::reverse_iterator<const char*> rend() const { return std::make_reverse_iterator(begin()); }
std::reverse_iterator<const char*> rbegin() const { return std::make_reverse_iterator(end()); }
std::reverse_iterator<const char*> rend() const { return std::make_reverse_iterator(begin()); }

constexpr const char* data() const { return m_ptr; }
constexpr size_t size() const { return m_size; }
Expand Down
6 changes: 4 additions & 2 deletions toolsrc/src/vcpkg/sourceparagraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ namespace vcpkg
constexpr static StringLiteral FEATURES = "features";
constexpr static StringLiteral DEFAULT_FEATURES = "default-features";
constexpr static StringLiteral PLATFORM = "platform";
constexpr static StringView KNOWN_FIELDS[] = {NAME, FEATURES, DEFAULT_FEATURES, PLATFORM};
const static StringView KNOWN_FIELDS[4]; // not constexpr in MSVC 2015

Optional<Dependency> visit_string(Json::Reader&, StringView, StringView sv)
{
Expand Down Expand Up @@ -889,6 +889,7 @@ namespace vcpkg
return dep;
}
};
const StringView DependencyField::KNOWN_FIELDS[] = {NAME, FEATURES, DEFAULT_FEATURES, PLATFORM};

struct FeatureField : Json::VisitorCrtpBase<FeatureField>
{
Expand All @@ -898,7 +899,7 @@ namespace vcpkg
constexpr static StringLiteral NAME = "name";
constexpr static StringLiteral DESCRIPTION = "description";
constexpr static StringLiteral DEPENDENCIES = "dependencies";
constexpr static StringView KNOWN_FIELDS[] = {NAME, DESCRIPTION, DEPENDENCIES};
const static StringView KNOWN_FIELDS[3]; // Not constexpr in MSVC 2015

Optional<std::unique_ptr<FeatureParagraph>> visit_object(Json::Reader& r, StringView, const Json::Object& obj)
{
Expand Down Expand Up @@ -930,6 +931,7 @@ namespace vcpkg
return std::move(feature);
}
};
const StringView FeatureField::KNOWN_FIELDS[] = {NAME, DESCRIPTION, DEPENDENCIES};

Parse::ParseExpected<SourceControlFile> SourceControlFile::parse_manifest_file(const fs::path& path_to_manifest,
const Json::Object& manifest)
Expand Down
105 changes: 0 additions & 105 deletions toolsrc/vcpkg.sln

This file was deleted.

Loading

0 comments on commit 40c8aab

Please sign in to comment.