aboutsummaryrefslogtreecommitdiff
path: root/toolsrc
diff options
context:
space:
mode:
authorAybe <aybe@users.noreply.github.com>2018-08-08 21:15:47 +0200
committerAybe <aybe@users.noreply.github.com>2018-08-08 21:15:47 +0200
commit61820777517d669e00fbdeb2368e156b66396b51 (patch)
tree57e0d31ff7b8fc3f85fd3bfe98148ef715149b6c /toolsrc
parent8cfc78e890b18762f1f5d0aff346c397de2e6d56 (diff)
parent13e19f10ea83985708320542cbf05217b4da9969 (diff)
downloadvcpkg-61820777517d669e00fbdeb2368e156b66396b51.tar.gz
vcpkg-61820777517d669e00fbdeb2368e156b66396b51.zip
Merge branch 'master' into liblzma-uwp
Diffstat (limited to 'toolsrc')
-rw-r--r--toolsrc/src/vcpkg/base/files.cpp2
-rw-r--r--toolsrc/src/vcpkg/build.cpp64
-rw-r--r--toolsrc/vcpkg.natvis35
-rw-r--r--toolsrc/vcpkg.sln5
4 files changed, 83 insertions, 23 deletions
diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp
index a6fbfbd73..4ff0912d1 100644
--- a/toolsrc/src/vcpkg/base/files.cpp
+++ b/toolsrc/src/vcpkg/base/files.cpp
@@ -263,7 +263,7 @@ namespace vcpkg::Files
for (auto&& ext : EXTS)
{
auto p = fs::u8path(base + ext.c_str());
- if (Util::find(ret, p) != ret.end() && this->exists(p))
+ if (Util::find(ret, p) == ret.end() && this->exists(p))
{
ret.push_back(p);
Debug::println("Found path: %s", p.u8string());
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp
index dc7653795..8e87fe7fe 100644
--- a/toolsrc/src/vcpkg/build.cpp
+++ b/toolsrc/src/vcpkg/build.cpp
@@ -1,9 +1,9 @@
#include "pch.h"
-#include <vcpkg/base/hash.h>
#include <vcpkg/base/checks.h>
#include <vcpkg/base/chrono.h>
#include <vcpkg/base/enums.h>
+#include <vcpkg/base/hash.h>
#include <vcpkg/base/optional.h>
#include <vcpkg/base/stringliteral.h>
#include <vcpkg/base/system.h>
@@ -473,11 +473,6 @@ namespace vcpkg::Build
abi_tag_entries.emplace_back(
AbiEntry{"control", vcpkg::Hash::get_file_hash(fs, config.port_dir / "CONTROL", "SHA1")});
- if (pre_build_info.cmake_system_name == "Linux")
- {
- abi_tag_entries.emplace_back(AbiEntry{"toolchain", "1"});
- }
-
abi_tag_entries.emplace_back(AbiEntry{"triplet", pre_build_info.triplet_abi_tag});
const std::string features = Strings::join(";", config.feature_list);
@@ -798,21 +793,6 @@ namespace vcpkg::Build
const fs::path ports_cmake_script_path = paths.scripts / "get_triplet_environment.cmake";
const fs::path triplet_file_path = paths.triplets / (triplet.canonical_name() + ".cmake");
- const std::string triplet_abi_tag = [&]() {
- static std::map<fs::path, std::string> s_hash_cache;
-
- auto it_hash = s_hash_cache.find(triplet_file_path);
- if (it_hash != s_hash_cache.end())
- {
- return it_hash->second;
- }
- auto hash = Hash::get_file_hash(paths.get_filesystem(), triplet_file_path, "SHA1");
- s_hash_cache.emplace(triplet_file_path, hash);
- return hash;
-
- return std::string();
- }();
-
const auto cmd_launch_cmake = System::make_cmake_cmd(cmake_exe_path,
ports_cmake_script_path,
{
@@ -824,7 +804,6 @@ namespace vcpkg::Build
const std::vector<std::string> lines = Strings::split(ec_data.output, "\n");
PreBuildInfo pre_build_info;
- pre_build_info.triplet_abi_tag = triplet_abi_tag;
const auto e = lines.cend();
auto cur = std::find(lines.cbegin(), e, FLAG_GUID);
@@ -900,6 +879,47 @@ namespace vcpkg::Build
Checks::exit_with_message(VCPKG_LINE_INFO, "Unknown variable name %s", line);
}
+ pre_build_info.triplet_abi_tag = [&]() {
+ const auto& fs = paths.get_filesystem();
+ static std::map<fs::path, std::string> s_hash_cache;
+
+ auto it_hash = s_hash_cache.find(triplet_file_path);
+ if (it_hash != s_hash_cache.end())
+ {
+ return it_hash->second;
+ }
+ auto hash = Hash::get_file_hash(fs, triplet_file_path, "SHA1");
+
+ if (auto p = pre_build_info.external_toolchain_file.get())
+ {
+ hash += "-";
+ hash += Hash::get_file_hash(fs, *p, "SHA1");
+ }
+ else if (pre_build_info.cmake_system_name == "Linux")
+ {
+ hash += "-";
+ hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "linux.cmake", "SHA1");
+ }
+ else if (pre_build_info.cmake_system_name == "Darwin")
+ {
+ hash += "-";
+ hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "osx.cmake", "SHA1");
+ }
+ else if (pre_build_info.cmake_system_name == "FreeBSD")
+ {
+ hash += "-";
+ hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "freebsd.cmake", "SHA1");
+ }
+ else if (pre_build_info.cmake_system_name == "Android")
+ {
+ hash += "-";
+ hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "android.cmake", "SHA1");
+ }
+
+ s_hash_cache.emplace(triplet_file_path, hash);
+ return hash;
+ }();
+
return pre_build_info;
}
ExtendedBuildResult::ExtendedBuildResult(BuildResult code) : code(code) {}
diff --git a/toolsrc/vcpkg.natvis b/toolsrc/vcpkg.natvis
new file mode 100644
index 000000000..7f9c7f61e
--- /dev/null
+++ b/toolsrc/vcpkg.natvis
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
+ <Type Name="vcpkg::ErrorHolder&lt;std::error_code&gt;">
+ <DisplayString Condition="m_err._Myval!=0">{m_err}</DisplayString>
+ <DisplayString Condition="m_err._Myval==0"></DisplayString>
+ </Type>
+ <Type Name="vcpkg::ErrorHolder&lt;*&gt;">
+ <DisplayString Condition="m_is_error==true">{m_err}</DisplayString>
+ <DisplayString Condition="m_is_error==false"></DisplayString>
+ </Type>
+ <Type Name="vcpkg::ExpectedT&lt;*,std::error_code&gt;">
+ <DisplayString Condition="m_s.m_err._Myval==0">val: {m_t}</DisplayString>
+ <DisplayString Condition="m_s.m_err._Myval!=0">err: {m_s}</DisplayString>
+ </Type>
+ <Type Name="vcpkg::ExpectedT&lt;*,*&gt;">
+ <DisplayString Condition="m_s.m_is_error==false">val: {m_t}</DisplayString>
+ <DisplayString Condition="m_s.m_is_error==true">err: {m_s}</DisplayString>
+ </Type>
+ <Type Name="vcpkg::Optional&lt;*&gt;">
+ <DisplayString Condition="m_base.m_is_present==true">{m_base.m_t}</DisplayString>
+ <DisplayString Condition="m_base.m_is_present==false">empty</DisplayString>
+ </Type>
+ <Type Name="vcpkg::TripletInstance">
+ <DisplayString>{*(std::string*)this}</DisplayString>
+ </Type>
+ <Type Name="vcpkg::Triplet">
+ <DisplayString>{m_instance}</DisplayString>
+ </Type>
+ <Type Name="vcpkg::StringLiteral">
+ <DisplayString>{m_cstr}</DisplayString>
+ </Type>
+ <Type Name="std::experimental::filesystem::v1::path">
+ <DisplayString>{_Mystr}</DisplayString>
+ </Type>
+</AutoVisualizer> \ No newline at end of file
diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln
index 9a998e214..6b92c973b 100644
--- a/toolsrc/vcpkg.sln
+++ b/toolsrc/vcpkg.sln
@@ -47,6 +47,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cmake", "cmake", "{A0122231
..\scripts\cmake\vcpkg_install_meson.cmake = ..\scripts\cmake\vcpkg_install_meson.cmake
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BCE555DF-F471-4ACC-98E5-76CBE8E8F79E}"
+ ProjectSection(SolutionItems) = preProject
+ vcpkg.natvis = vcpkg.natvis
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64