Am Sonntag, 15. September 2019, 23:22:51 CEST schrieb Albert Astals Cid: > El dilluns, 9 de setembre de 2019, a les 19:28:11 CEST, Friedrich W. H. Kossebau va escriure: > > Hi, > > > > developer using KDE Frameworks libraries in your projects, how would you > > like to be able to control warnings about deprecated API in those > > libraries? Or control the visibility of deprecated API to your code when > > building?
This here is actually where I hoped you would be inspired to give examples of your needs and how you would like to express them initially. Before thinking about the proposed approach and terms. :) > > There is a prototype to enhance KDE Frameworks API, so developers building > > against KDE Frameworks libraries could use flags like > > > > -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0xXYZ This hides to the compiler all API in the headers which has been deprecated before and at version x.y.z. Any API deprecated in newer versions will stay visible. > > -DKF_DEPRECATED_WARNINGS_SINCE=0xXYZ This enables warnings for usage of deprecated API for the compiler with all API which has been deprecated before and at version x.y.z. Any API deprecated in newer versions will not be warned about. > > -DKF_NO_DEPRECATED_WARNINGS Shortcut for setting KF_DEPRECATED_WARNINGS_SINCE to 0, i.e. having the compiler not warn about any deprecated API in KF libs. > > -DKF_NO_DEPRECATED Shortcut for setting KF_DISABLE_DEPRECATED_BEFORE_AND_AT to latest version, i.e. making all deprecated API in KF libs invisible to the compiler. > When we understand their purpose we may suggest better names? As said, motivation for current naming proposals has been to be consistent with the ones of Qt... * QT_DISABLE_DEPRECATED_BEFORE (misnomer, actually before and at) * QT_NO_DEPRECATED_WARNINGS * QT_DEPRECATED_WARNINGS_SINCE (not in public docs though) -> https://doc.qt.io/qt-5/qtglobal.html ... as well as the name created by CMake's generate_export_header() macro and already used in KF libraries' code: * ${BASE_NAME}_NO_DEPRECATED -> https://cmake.org/cmake/help/latest/module/GenerateExportHeader.html Cheers Friedrich