diff options
| author | nicole mazzuca <mazzucan@outlook.com> | 2020-09-04 11:49:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-04 11:49:56 -0700 |
| commit | 4467eb334aa93b18858305697cf8c20950c4e925 (patch) | |
| tree | 527b5855ef13af278459761f667e3c7568126321 | |
| parent | a3142da3ac59928d694de35631d174b19c06a471 (diff) | |
| download | vcpkg-4467eb334aa93b18858305697cf8c20950c4e925.tar.gz vcpkg-4467eb334aa93b18858305697cf8c20950c4e925.zip | |
fix compile on g++ 6 (#13290)
| -rw-r--r-- | toolsrc/cmake/utilities.cmake | 2 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/base/json.h | 6 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/configuration.cpp | 3 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/metrics.cpp | 1 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/registries.cpp | 7 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/sourceparagraph.cpp | 28 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/vcpkgcmdarguments.cpp | 42 |
7 files changed, 85 insertions, 4 deletions
diff --git a/toolsrc/cmake/utilities.cmake b/toolsrc/cmake/utilities.cmake index f04c1ddbb..429a86f5f 100644 --- a/toolsrc/cmake/utilities.cmake +++ b/toolsrc/cmake/utilities.cmake @@ -129,7 +129,7 @@ int main() {} int main() {} ]] _VCPKG_USE_STD_FILESYSTEM) - + if(_VCPKG_REQUIRE_LINK_CXXFS) set(_VCPKG_CXXFS_LIBRARY "stdc++fs") endif() diff --git a/toolsrc/include/vcpkg/base/json.h b/toolsrc/include/vcpkg/base/json.h index 3539f2df4..7cdcb0162 100644 --- a/toolsrc/include/vcpkg/base/json.h +++ b/toolsrc/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 { diff --git a/toolsrc/src/vcpkg/configuration.cpp b/toolsrc/src/vcpkg/configuration.cpp index adc1f814d..1bce07acf 100644 --- a/toolsrc/src/vcpkg/configuration.cpp +++ b/toolsrc/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(); diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index d5cd0a47f..019b3a9c2 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/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) diff --git a/toolsrc/src/vcpkg/registries.cpp b/toolsrc/src/vcpkg/registries.cpp index 5df38e6ef..eda20f1b9 100644 --- a/toolsrc/src/vcpkg/registries.cpp +++ b/toolsrc/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[] = { diff --git a/toolsrc/src/vcpkg/sourceparagraph.cpp b/toolsrc/src/vcpkg/sourceparagraph.cpp index a00fd7579..94a5dbe41 100644 --- a/toolsrc/src/vcpkg/sourceparagraph.cpp +++ b/toolsrc/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) { diff --git a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp index 18288104f..d56de23a8 100644 --- a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp +++ b/toolsrc/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; } |
