mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
cmExportPackageInfoGenerator: Fix -Wdeprecated-redundant-constexpr-static-def
In commit 3d52d70b84 (export: Add initial CPS support, 2024-07-26) we
added a static definition of a `constexpr` member to help older
AppleClang and SunPro linkers. This is deprecated by C++17 and Clang
now warns about it, so preserving the approach would require complex
conditions. There is no significant benefit to `constexpr` here, so use
a traditional file-scoped definition instead.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#include "cmTarget.h"
|
||||
#include "cmValue.h"
|
||||
|
||||
constexpr char const* cmExportPackageInfoGenerator::CPS_VERSION_STR;
|
||||
static const std::string kCPS_VERSION_STR = "0.12.0";
|
||||
|
||||
cmExportPackageInfoGenerator::cmExportPackageInfoGenerator(
|
||||
std::string packageName, std::string version, std::string versionCompat,
|
||||
@@ -102,7 +102,7 @@ Json::Value cmExportPackageInfoGenerator::GeneratePackageInfo() const
|
||||
Json::Value package;
|
||||
|
||||
package["name"] = this->GetPackageName();
|
||||
package["cps_version"] = this->CPS_VERSION_STR;
|
||||
package["cps_version"] = std::string(kCPS_VERSION_STR);
|
||||
|
||||
if (!this->PackageVersion.empty()) {
|
||||
package["version"] = this->PackageVersion;
|
||||
|
||||
@@ -111,6 +111,4 @@ private:
|
||||
|
||||
std::map<std::string, std::string> LinkTargets;
|
||||
std::set<std::string> Requirements;
|
||||
|
||||
static constexpr char const* CPS_VERSION_STR = "0.12.0";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user