diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-05-03 16:33:02 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-05-04 15:06:18 -0700 |
| commit | 7bdf189a921fdee47044e907a3ff48ce8c880fe2 (patch) | |
| tree | f9e5b253020e4134ad58562fccece9d7832c6df5 /toolsrc/include | |
| parent | a66b066d4584d6b92d249d71b9348344efc78d5e (diff) | |
| download | vcpkg-7bdf189a921fdee47044e907a3ff48ce8c880fe2.tar.gz vcpkg-7bdf189a921fdee47044e907a3ff48ce8c880fe2.zip | |
Rework vcpkg's triplet environment reading
The triplet is "run" and vcpkg observes the environment.
Previously, the environment was deduced by the triplet's name
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/PostBuildLint.h | 5 | ||||
| -rw-r--r-- | toolsrc/include/triplet.h | 2 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Build.h | 13 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_System.h | 12 |
4 files changed, 27 insertions, 5 deletions
diff --git a/toolsrc/include/PostBuildLint.h b/toolsrc/include/PostBuildLint.h index 0ee47d0c1..69fafc9f7 100644 --- a/toolsrc/include/PostBuildLint.h +++ b/toolsrc/include/PostBuildLint.h @@ -5,5 +5,8 @@ namespace vcpkg::PostBuildLint { - size_t perform_all_checks(const PackageSpec& spec, const VcpkgPaths& paths, const Build::BuildInfo& build_info); + size_t perform_all_checks(const PackageSpec& spec, + const VcpkgPaths& paths, + const Build::PreBuildInfo& pre_build_info, + const Build::BuildInfo& build_info); } diff --git a/toolsrc/include/triplet.h b/toolsrc/include/triplet.h index 4d837bc47..e634afd3f 100644 --- a/toolsrc/include/triplet.h +++ b/toolsrc/include/triplet.h @@ -15,8 +15,6 @@ namespace vcpkg static const Triplet ARM_UWP; const std::string& canonical_name() const; - std::string architecture() const; - std::string system() const; const std::string& to_string() const; private: diff --git a/toolsrc/include/vcpkg_Build.h b/toolsrc/include/vcpkg_Build.h index 28ddb0d16..4deb81900 100644 --- a/toolsrc/include/vcpkg_Build.h +++ b/toolsrc/include/vcpkg_Build.h @@ -8,7 +8,6 @@ #include "vcpkg_Files.h" #include "vcpkg_optional.h" #include <map> -#include <string> #include <unordered_map> #include <vector> @@ -33,7 +32,17 @@ namespace vcpkg::Build std::string create_error_message(const BuildResult build_result, const PackageSpec& spec); std::string create_user_troubleshooting_message(const PackageSpec& spec); - std::wstring make_build_env_cmd(const Triplet& triplet, const Toolset& toolset); + struct PreBuildInfo + { + static PreBuildInfo from_triplet_file(const VcpkgPaths& paths, const Triplet& triplet); + + std::string target_architecture; + std::string cmake_system_name; + std::string cmake_system_version; + std::string platform_toolset; + }; + + std::wstring make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset); struct ExtendedBuildResult { diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index bb478944a..71033a642 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -65,6 +65,18 @@ namespace vcpkg::System Optional<std::wstring> get_registry_string(HKEY base, const CWStringView subkey, const CWStringView valuename); + enum class CPUArchitecture + { + X86, + X64, + ARM, + ARM64, + }; + + Optional<CPUArchitecture> to_cpu_architecture(CStringView arch); + + CPUArchitecture get_host_processor(); + const fs::path& get_ProgramFiles_32_bit(); const fs::path& get_ProgramFiles_platform_bitness(); |
