Remove the STATIC_LIBRARY option to fix static builds
ClosedPublic

Authored by bartoc on Mar 16 2020, 3:07 AM.

Details

Summary

Previously static builds were broken because
GenerateExportHeader used:
get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)
which returns STATIC_LIBRARY, however since we had an
option of the same name that variable was "dobule expanded"
in if statements, breaking GenerateExportHeader's logic

Additionally remove the legacy style elseif(...) and endif(...) form
conditionals

fixes https://bugs.kde.org/show_bug.cgi?id=418905

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
bartoc created this revision.Mar 16 2020, 3:07 AM
Restricted Application added a subscriber: plasma-devel. · View Herald TranscriptMar 16 2020, 3:07 AM
bartoc requested review of this revision.Mar 16 2020, 3:07 AM
apol added a subscriber: apol.Mar 16 2020, 11:32 AM

Makes sense to me. +1

Since most people who did static builds will be using STATIC_LIBRARY, can you set a fatal error if it's on, so the devs know to use BUILD_SHARED_LIBS instead?

In D28066#628195, @apol wrote:

Makes sense to me. +1

Since most people who did static builds will be using STATIC_LIBRARY, can you set a fatal error if it's on, so the devs know to use BUILD_SHARED_LIBS instead?

Allright. I'm also looking into making a plugin target get installed so you can link against kirigamiplugin.lib in cmake.

bartoc updated this revision to Diff 78262.Mar 23 2020, 3:19 AM

Made setting STATIC_LIBRARY a fatal error.

bartoc added a comment.Apr 3 2020, 7:19 AM

Can I get any more feedback on this? what do I have to do to get it merged?

apol accepted this revision.Apr 6 2020, 12:02 AM
This revision is now accepted and ready to land.Apr 6 2020, 12:02 AM
bartoc updated this revision to Diff 79439.Apr 6 2020, 12:05 AM

rebased on master

This revision was automatically updated to reflect the committed changes.