SUMMARY See this pipeline run for details: https://invent.kde.org/frameworks/kfilemetadata/-/jobs/485282 97%] Linking CXX executable ../bin/externalwritertest /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: ../lib/libKF5FileMetaData.a(mocs_compilation.cpp.o): in function `KFileMetaData::ExternalWriter::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)': /builds/frameworks/kfilemetadata/_build/src/KF5FileMetaData_autogen/EWIEGA46WW/moc_externalwriter.cpp:59: multiple definition of `KFileMetaData::ExternalWriter::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)'; CMakeFiles/externalwritertest.dir/externalwritertest_autogen/mocs_compilation.cpp.o:/builds/frameworks/kfilemetadata/_build/autotests/externalwritertest_autogen/VNU7RW3YIC/moc_externalwriter.cpp:59: first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: ../lib/libKF5FileMetaData.a(mocs_compilation.cpp.o):(.data.rel.ro.local+0x60): multiple definition of `KFileMetaData::ExternalWriter::staticMetaObject'; CMakeFiles/externalwritertest.dir/externalwritertest_autogen/mocs_compilation.cpp.o:(.data.rel.ro+0x60): first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: ../lib/libKF5FileMetaData.a(mocs_compilation.cpp.o): in function `KFileMetaData::ExternalWriter::metaObject() const': /builds/frameworks/kfilemetadata/_build/src/KF5FileMetaData_autogen/EWIEGA46WW/moc_externalwriter.cpp:77: multiple definition of `KFileMetaData::ExternalWriter::metaObject() const'; CMakeFiles/externalwritertest.dir/externalwritertest_autogen/mocs_compilation.cpp.o:/builds/frameworks/kfilemetadata/_build/autotests/externalwritertest_autogen/VNU7RW3YIC/moc_externalwriter.cpp:77: first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: ../lib/libKF5FileMetaData.a(mocs_compilation.cpp.o): in function `KFileMetaData::ExternalWriter::qt_metacast(char const*)': /builds/frameworks/kfilemetadata/_build/src/KF5FileMetaData_autogen/EWIEGA46WW/moc_externalwriter.cpp:82: multiple definition of `KFileMetaData::ExternalWriter::qt_metacast(char const*)'; CMakeFiles/externalwritertest.dir/externalwritertest_autogen/mocs_compilation.cpp.o:/builds/frameworks/kfilemetadata/_build/autotests/externalwritertest_autogen/VNU7RW3YIC/moc_externalwriter.cpp:82: first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: ../lib/libKF5FileMetaData.a(mocs_compilation.cpp.o): in function `KFileMetaData::ExternalWriter::qt_metacall(QMetaObject::Call, int, void**)': /builds/frameworks/kfilemetadata/_build/src/KF5FileMetaData_autogen/EWIEGA46WW/moc_externalwriter.cpp:90: multiple definition of `KFileMetaData::ExternalWriter::qt_metacall(QMetaObject::Call, int, void**)'; CMakeFiles/externalwritertest.dir/externalwritertest_autogen/mocs_compilation.cpp.o:/builds/frameworks/kfilemetadata/_build/autotests/externalwritertest_autogen/VNU7RW3YIC/moc_externalwriter.cpp:90: first defined here /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: ../lib/libKF5FileMetaData.a(mocs_compilation.cpp.o):(.bss+0x4c2): multiple definition of `__odr_asan._ZN13KFileMetaData14ExternalWriter16staticMetaObjectE'; CMakeFiles/externalwritertest.dir/externalwritertest_autogen/mocs_compilation.cpp.o:(.bss+0x340): first defined here
This might be trickier, but I will give it a look :)
https://invent.kde.org/frameworks/kfilemetadata/-/merge_requests/65
Git commit b25af779834ae88b45b8e2d529cdb5636930e2ab by Alexander Lohnau. Committed on 24/09/2022 at 08:21. Pushed by wrobelda into branch 'master'. Fix compilation of tests in static builds If we build statically, we can not add the source files twice, because then we have duplicated symbols. Though for shared builds we need it, because the classes are not exported. M +2 -2 autotests/CMakeLists.txt https://invent.kde.org/frameworks/kfilemetadata/commit/b25af779834ae88b45b8e2d529cdb5636930e2ab