fix compile on g++ 6
MODIFY
include/vcpkg/base/json.h
include/vcpkg/base/json.h
@@ -287,8 +287,8 @@ namespace vcpkg::Json
underlying_t underlying_;
};
- VCPKG_MSVC_WARNING(push);
- VCPKG_MSVC_WARNING(disable : 4505);
+ VCPKG_MSVC_WARNING(push)
+ VCPKG_MSVC_WARNING(disable : 4505)
template<class Type>
Span<const StringView> IDeserializer<Type>::valid_fields() const
@@ -332,7 +332,7 @@ namespace vcpkg::Json
return nullopt;
}
- VCPKG_MSVC_WARNING(pop);
+ VCPKG_MSVC_WARNING(pop)
struct ReaderError
{

MODIFY
src/vcpkg/configuration.cpp
src/vcpkg/configuration.cpp
@@ -57,6 +57,9 @@ namespace vcpkg
return Configuration{std::move(registries)};
}
+ constexpr StringLiteral ConfigurationDeserializer::DEFAULT_REGISTRY;
+ constexpr StringLiteral ConfigurationDeserializer::REGISTRIES;
+
ConfigurationDeserializer::ConfigurationDeserializer(const VcpkgCmdArguments& args)
{
registries_enabled = args.registries_enabled();

MODIFY
src/vcpkg/metrics.cpp
src/vcpkg/metrics.cpp
@@ -38,6 +38,7 @@ namespace vcpkg::Metrics
res.push_back(hex[(bits >> 0) & 0x0F]);
}
};
+ constexpr char append_hexits::hex[17];
// note: this ignores the bits of these numbers that would be where format and variant go
static std::string uuid_of_integers(uint64_t top, uint64_t bottom)

MODIFY
src/vcpkg/registries.cpp
src/vcpkg/registries.cpp
@@ -34,6 +34,11 @@ namespace vcpkg
StringView RegistryImplDeserializer::type_name() const { return "a registry"; }
+ constexpr StringLiteral RegistryImplDeserializer::KIND;
+ constexpr StringLiteral RegistryImplDeserializer::PATH;
+ constexpr StringLiteral RegistryImplDeserializer::KIND_BUILTIN;
+ constexpr StringLiteral RegistryImplDeserializer::KIND_DIRECTORY;
+
Span<const StringView> RegistryImplDeserializer::valid_fields() const
{
static const StringView t[] = {KIND, PATH};
@@ -76,6 +81,8 @@ namespace vcpkg
StringView RegistryDeserializer::type_name() const { return "a registry"; }
+ constexpr StringLiteral RegistryDeserializer::PACKAGES;
+
Span<const StringView> RegistryDeserializer::valid_fields() const
{
static const StringView t[] = {

MODIFY
src/vcpkg/sourceparagraph.cpp
src/vcpkg/sourceparagraph.cpp
@@ -442,6 +442,11 @@ namespace vcpkg
}
};
+ constexpr StringLiteral DependencyDeserializer::NAME;
+ constexpr StringLiteral DependencyDeserializer::FEATURES;
+ constexpr StringLiteral DependencyDeserializer::DEFAULT_FEATURES;
+ constexpr StringLiteral DependencyDeserializer::PLATFORM;
+
struct FeatureDeserializer : Json::IDeserializer<std::unique_ptr<FeatureParagraph>>
{
virtual StringView type_name() const override { return "a feature"; }
@@ -482,6 +487,10 @@ namespace vcpkg
}
};
+ constexpr StringLiteral FeatureDeserializer::NAME;
+ constexpr StringLiteral FeatureDeserializer::DESCRIPTION;
+ constexpr StringLiteral FeatureDeserializer::DEPENDENCIES;
+
// We "parse" this so that we can add actual license parsing at some point in the future
// without breaking anyone
struct LicenseExpressionDeserializer : Json::IDeserializer<std::string>
@@ -622,6 +631,10 @@ namespace vcpkg
}
};
+ constexpr StringView LicenseExpressionDeserializer::EXPRESSION_WORDS[];
+ constexpr StringView LicenseExpressionDeserializer::VALID_LICENSES[];
+ constexpr StringView LicenseExpressionDeserializer::VALID_EXCEPTIONS[];
+
struct ManifestDeserializer : Json::IDeserializer<std::unique_ptr<SourceControlFile>>
{
virtual StringView type_name() const override { return "a manifest"; }
@@ -721,6 +734,21 @@ namespace vcpkg
}
};
+ constexpr StringLiteral ManifestDeserializer::NAME;
+ constexpr StringLiteral ManifestDeserializer::VERSION;
+
+ constexpr StringLiteral ManifestDeserializer::PORT_VERSION;
+ constexpr StringLiteral ManifestDeserializer::MAINTAINERS;
+ constexpr StringLiteral ManifestDeserializer::DESCRIPTION;
+ constexpr StringLiteral ManifestDeserializer::HOMEPAGE;
+ constexpr StringLiteral ManifestDeserializer::DOCUMENTATION;
+ constexpr StringLiteral ManifestDeserializer::LICENSE;
+ constexpr StringLiteral ManifestDeserializer::DEPENDENCIES;
+ constexpr StringLiteral ManifestDeserializer::DEV_DEPENDENCIES;
+ constexpr StringLiteral ManifestDeserializer::FEATURES;
+ constexpr StringLiteral ManifestDeserializer::DEFAULT_FEATURES;
+ constexpr StringLiteral ManifestDeserializer::SUPPORTS;
+
Parse::ParseExpected<SourceControlFile> SourceControlFile::parse_manifest_file(const fs::path& path_to_manifest,
const Json::Object& manifest)
{

MODIFY
src/vcpkg/vcpkgcmdarguments.cpp
src/vcpkg/vcpkgcmdarguments.cpp
@@ -856,4 +856,46 @@ namespace vcpkg
}
m_str.append(line_start, best_break);
}
+
+ // out-of-line definitions since C++14 doesn't allow inline constexpr static variables
+ constexpr StringLiteral VcpkgCmdArguments::VCPKG_ROOT_DIR_ENV;
+ constexpr StringLiteral VcpkgCmdArguments::VCPKG_ROOT_DIR_ARG;
+ constexpr StringLiteral VcpkgCmdArguments::MANIFEST_ROOT_DIR_ARG;
+
+ constexpr StringLiteral VcpkgCmdArguments::BUILDTREES_ROOT_DIR_ARG;
+ constexpr StringLiteral VcpkgCmdArguments::DOWNLOADS_ROOT_DIR_ENV;
+ constexpr StringLiteral VcpkgCmdArguments::DOWNLOADS_ROOT_DIR_ARG;
+ constexpr StringLiteral VcpkgCmdArguments::INSTALL_ROOT_DIR_ARG;
+ constexpr StringLiteral VcpkgCmdArguments::PACKAGES_ROOT_DIR_ARG;
+ constexpr StringLiteral VcpkgCmdArguments::SCRIPTS_ROOT_DIR_ARG;
+
+ constexpr StringLiteral VcpkgCmdArguments::DEFAULT_VISUAL_STUDIO_PATH_ENV;
+
+ constexpr StringLiteral VcpkgCmdArguments::TRIPLET_ENV;
+ constexpr StringLiteral VcpkgCmdArguments::TRIPLET_ARG;
+ constexpr StringLiteral VcpkgCmdArguments::OVERLAY_PORTS_ENV;
+ constexpr StringLiteral VcpkgCmdArguments::OVERLAY_PORTS_ARG;
+ constexpr StringLiteral VcpkgCmdArguments::OVERLAY_TRIPLETS_ARG;
+
+ constexpr StringLiteral VcpkgCmdArguments::BINARY_SOURCES_ARG;
+
+ constexpr StringLiteral VcpkgCmdArguments::DEBUG_SWITCH;
+ constexpr StringLiteral VcpkgCmdArguments::SEND_METRICS_SWITCH;
+ constexpr StringLiteral VcpkgCmdArguments::DISABLE_METRICS_ENV;
+ constexpr StringLiteral VcpkgCmdArguments::DISABLE_METRICS_SWITCH;
+ constexpr StringLiteral VcpkgCmdArguments::PRINT_METRICS_SWITCH;
+
+ constexpr StringLiteral VcpkgCmdArguments::WAIT_FOR_LOCK_SWITCH;
+
+ constexpr StringLiteral VcpkgCmdArguments::JSON_SWITCH;
+
+ constexpr StringLiteral VcpkgCmdArguments::FEATURE_FLAGS_ENV;
+ constexpr StringLiteral VcpkgCmdArguments::FEATURE_FLAGS_ARG;
+
+ constexpr StringLiteral VcpkgCmdArguments::FEATURE_PACKAGES_SWITCH;
+ constexpr StringLiteral VcpkgCmdArguments::BINARY_CACHING_FEATURE;
+ constexpr StringLiteral VcpkgCmdArguments::BINARY_CACHING_SWITCH;
+ constexpr StringLiteral VcpkgCmdArguments::COMPILER_TRACKING_FEATURE;
+ constexpr StringLiteral VcpkgCmdArguments::MANIFEST_MODE_FEATURE;
+ constexpr StringLiteral VcpkgCmdArguments::REGISTRIES_FEATURE;
}

fix compile on g++ 6 (#13290)