AttachmentUpdateJob needs to be exported even without BUILD_TESTING

Authored by marten on Mar 27 2019, 10:01 AM.



Compiling current messagelib source without BUILD_TESTING defined produces the error:

[ 73%] Linking CXX shared library ../../bin/
CMakeFiles/KF5MessageComposer.dir/attachment/attachmentcontrollerbase.cpp.o: In function `MessageComposer::AttachmentControllerBase::Private::updateJobResult(KJob*)':
messagelib/messagecomposer/src/attachment/attachmentcontrollerbase.cpp:292: undefined reference to `typeinfo for MessageCore::AttachmentUpdateJob'
messagelib/messagecomposer/src/attachment/attachmentcontrollerbase.cpp:294: undefined reference to `MessageCore::AttachmentUpdateJob::originalPart() const'
messagelib/messagecomposer/src/attachment/attachmentcontrollerbase.cpp:295: undefined reference to `MessageCore::AttachmentUpdateJob::updatedPart() const'
CMakeFiles/KF5MessageComposer.dir/attachment/attachmentcontrollerbase.cpp.o: In function `MessageComposer::AttachmentControllerBase::Private::reloadAttachment()':
messagelib/messagecomposer/src/attachment/attachmentcontrollerbase.cpp:279: undefined reference to `MessageCore::AttachmentUpdateJob::AttachmentUpdateJob(QSharedPointer<MessageCore::AttachmentPart> const&, QObject*)'
collect2: error: ld returned 1 exit status
make[2]: * [messagecomposer/src/CMakeFiles/KF5MessageComposer.dir/build.make:1252: bin/] Error 1
* [CMakeFiles/Makefile2:819: messagecomposer/src/CMakeFiles/KF5MessageComposer.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

This appears to be because AttachmentUpdateJob is only exported with MESSAGECORE_TESTS_EXPORT as a result of commit 7f6c2bdfc, but it is required by messagecomposer.

Test Plan

With this change, messagelib builds correctly with BUILD_TESTING not defined.

Diff Detail

R94 PIM: Message Library
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
marten created this revision.Mar 27 2019, 10:01 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMar 27 2019, 10:01 AM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
marten requested review of this revision.Mar 27 2019, 10:01 AM
mlaurent requested changes to this revision.Mar 27 2019, 10:12 AM
mlaurent added a subscriber: mlaurent.
mlaurent added inline comments.

Please fix header too

This revision now requires changes to proceed.Mar 27 2019, 10:12 AM
marten updated this revision to Diff 54923.Mar 27 2019, 10:23 AM

Use the standard export header

marten marked an inline comment as done.Mar 27 2019, 10:23 AM
mlaurent accepted this revision.Mar 27 2019, 11:45 AM
This revision is now accepted and ready to land.Mar 27 2019, 11:45 AM
This revision was automatically updated to reflect the committed changes.