Akonadi-contacts: define BUILD_TESTING in order that CONTACTEDITOR_TESTS_EXPORT is properly defined
ClosedPublic

Authored by kfunk on Apr 11 2020, 4:21 PM.

Details

Summary

An attempt to fix linking on Windows.

you'll notice that src/contact-editor/contacteditor_private_export.h does not properly define CONTACTEDITOR_TESTS_EXPORT unless BUILD_TESTING is defined

@vonreth if this works, would you be able to update craft to use it? perhaps with a patch?

Test Plan

seems to link ok on Windows now

Diff Detail

Repository
R459 Akonadi Contacts
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
winterz created this revision.Apr 11 2020, 4:21 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptApr 11 2020, 4:21 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
winterz requested review of this revision.Apr 11 2020, 4:21 PM
mlaurent requested changes to this revision.Apr 11 2020, 9:14 PM
mlaurent added inline comments.
src/contact-editor/CMakeLists.txt
228

add_definitions(-DBUILD_TESTING) only

This revision now requires changes to proceed.Apr 11 2020, 9:14 PM
winterz updated this revision to Diff 79918.Apr 12 2020, 11:25 AM
mlaurent requested changes to this revision.Apr 12 2020, 1:06 PM

Arg without arc it's not easy to see all code.

Add

if (BUILD_TESTING)
​ add_definitions(-DBUILD_TESTING) #properly define CONTACTEDITOR_TESTS_EXPORT
endif()

before to generate lib.
if you add before autotests lib will not compiled with correct flags.

This revision now requires changes to proceed.Apr 12 2020, 1:06 PM
mlaurent added a subscriber: kfunk.Apr 12 2020, 1:08 PM

see "2f552ac573770ce22ec5489b22c6269280aa4e36"
@kfunk ^

it seems that it changed it.
We need to know why.

ping. we need to get this sorted. the CI is complaining daily about the broken build on Windows

kfunk updated this revision to Diff 80361.Apr 17 2020, 9:57 AM
kfunk edited the test plan for this revision. (Show Details)

Revert original patch causing the breakage

dfaure accepted this revision.Apr 17 2020, 10:22 AM
kfunk updated this revision to Diff 80362.Apr 17 2020, 10:25 AM

Update.

Commit message:

Revert "Fix windows build"

That patch was wrong. BUILD_TESTING needs to always be defined when
testing is enabled so the *_TESTS_EXPORT macros are filled out properly.

I think this patch initially just worked around an issue which was fixed
by https://phabricator.kde.org/D20091.

Phabricator Revisino: https://phabricator.kde.org/D28759

This reverts commit 2f552ac573770ce22ec5489b22c6269280aa4e36.
mlaurent accepted this revision.Apr 17 2020, 10:43 AM
This revision is now accepted and ready to land.Apr 17 2020, 10:43 AM
kfunk commandeered this revision.Apr 17 2020, 11:19 AM
kfunk added a reviewer: winterz.
This revision was automatically updated to reflect the committed changes.