[vcpkg] Improve default triplets for non-windows
MODIFY
include/vcpkg/base/strings.h
include/vcpkg/base/strings.h
@@ -46,7 +46,7 @@ namespace vcpkg::Strings
bool case_insensitive_ascii_equals(const CStringView left, const CStringView right);
- std::string ascii_to_lowercase(const std::string& input);
+ std::string ascii_to_lowercase(std::string input);
bool case_insensitive_ascii_starts_with(const std::string& s, const std::string& pattern);

MODIFY
src/vcpkg.cpp
src/vcpkg.cpp
@@ -157,7 +157,15 @@ static void inner(const VcpkgCmdArguments& args)
}
else
{
+#if defined(_WIN32)
default_triplet = Triplet::X86_WINDOWS;
+#elif defined(__APPLE__)
+ default_triplet = Triplet::from_canonical_name("x64-osx");
+#elif defined(__FreeBSD__)
+ default_triplet = Triplet::from_canonical_name("x64-freebsd");
+#else
+ default_triplet = Triplet::from_canonical_name("x64-linux");
+#endif
}
}

MODIFY
src/vcpkg/base/strings.cpp
src/vcpkg/base/strings.cpp
@@ -108,11 +108,10 @@ namespace vcpkg::Strings
#endif
}
- std::string ascii_to_lowercase(const std::string& input)
+ std::string ascii_to_lowercase(std::string s)
{
- std::string output(input);
- std::transform(output.begin(), output.end(), output.begin(), &details::tolower_char);
- return output;
+ std::transform(s.begin(), s.end(), s.begin(), &details::tolower_char);
+ return s;
}
bool case_insensitive_ascii_starts_with(const std::string& s, const std::string& pattern)

[vcpkg] Improve default triplets for non-windows