Fix multiple definition error caused by forward declarations
This commit is contained in:
parent
712eb4fb28
commit
ef27d71f43
|
@ -10,7 +10,7 @@ set(META_APP_CATEGORIES "Utility;")
|
|||
set(META_GUI_OPTIONAL false)
|
||||
set(META_VERSION_MAJOR 0)
|
||||
set(META_VERSION_MINOR 0)
|
||||
set(META_VERSION_PATCH 6)
|
||||
set(META_VERSION_PATCH 7)
|
||||
set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH})
|
||||
set(META_CXX_STANDARD 17)
|
||||
|
||||
|
|
|
@ -67,6 +67,11 @@ void SerializationCodeGenerator::addDeclaration(clang::Decl *decl)
|
|||
SerializationCodeGenerator::IsRelevant SerializationCodeGenerator::isQualifiedNameIfRelevant(
|
||||
clang::CXXRecordDecl *record, const std::string &qualifiedName) const
|
||||
{
|
||||
// skip all classes which are only forward-declared
|
||||
if (!record->isCompleteDefinition()) {
|
||||
return IsRelevant::No;
|
||||
}
|
||||
|
||||
// consider all classes for which a specialization of the "AdaptedJsonSerializable" struct is available
|
||||
for (const auto &adaptionRecord : m_adaptionRecords) {
|
||||
// skip all adaption records which are only included
|
||||
|
|
|
@ -37,6 +37,11 @@ private:
|
|||
string privateString = "not going to be serialized";
|
||||
};
|
||||
|
||||
// forward declarations shouldn't cause the generator to emit the code multiple times
|
||||
struct TestStruct;
|
||||
struct TestStruct;
|
||||
struct TestStruct;
|
||||
|
||||
class JsonGeneratorTests;
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Reference in New Issue