Use ECMGenerateExportHeader to manage deprecated API better
ClosedPublic

Authored by kossebau on Oct 15 2019, 11:10 PM.

Details

Summary

Allows

  • projects linking to KCalendarCore to hide deprecated API up to a given version or silence deprecation warnings after a given version, using
    • -DKCALENDARCORE_DISABLE_DEPRECATED_BEFORE_AND_AT
    • -DKCALENDARCORE_NO_DEPRECATED
    • -DKCALENDARCORE_DEPRECATED_WARNINGS_SINCE
    • -DKCALENDARCORE_NO_DEPRECATED_WARNINGS

      or
    • -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT
    • -DKF_NO_DEPRECATED
    • -DKF_DEPRECATED_WARNINGS_SINCE
    • -DKF_NO_DEPRECATED_WARNINGS
  • to build KCalendarCore optionally with deprecated API excluded from the build, using "EXCLUDE_DEPRECATED_BEFORE_AND_AT" cmake argument.
Test Plan

Builds with EXCLUDE_DEPRECATED_BEFORE_AND_AT set to 0, 5.64.0, CURRENT.

Diff Detail

Branch
useECMGenerateExportHeader
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17731
Build 17749: arc lint + arc unit
kossebau requested review of this revision.Oct 15 2019, 11:10 PM
kossebau created this revision.
kossebau added inline comments.Oct 15 2019, 11:14 PM
src/recurrence.h
149

Only using KCALENDARCORE_BUILD_DEPRECATED_SINCE here and not KCALENDARCORE_ENABLE_DEPRECATED_SINCE, because we have no idea yet how all compilers would deal with any tricks to hide the method here, given the alternative chance of implicitly-declared copy assignment operator.

So this method for now can be only excluded from build, but not made invisible to library consumers if build in.

Needs more investigations

vkrause accepted this revision.Oct 16 2019, 6:39 AM
This revision is now accepted and ready to land.Oct 16 2019, 6:39 AM
kossebau closed this revision.Oct 16 2019, 8:14 PM