[REVERTED] Re: C and C++ compiler extensions disabled in extra-cmake-modules

Friedrich W. H. Kossebau kossebau at kde.org
Mon Jun 28 14:14:13 BST 2021


Am Montag, 28. Juni 2021, 01:05:37 CEST schrieb Albert Astals Cid:
> With
> https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/145
> we have disabled the C and C++ specific compiler extensions.
> 
> This has already let to some code failing to build that was using C
> extensions, and has been fixed by simply requiring a more recent C
> https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/23
> https://invent.kde.org/frameworks/bluez-qt/-/merge_requests/10
>   https://invent.kde.org/frameworks/kwayland/-/merge_requests/34

With some more aftermath done, we found this unconditional setting creates too 
much trouble, so the change has been reverted now for KDECompilerSettings.

Still while at it you want to consider for now to manually add to your 
project's CMakeLists.txt these lines (can be anywhere before first targets are 
added):

    set(CMAKE_C_EXTENSIONS OFF)
    set(CMAKE_CXX_EXTENSIONS OFF)

That should ensure that your code (and any external dependencies it pulls in) 
is by default more standards-compliant and portable.

Future KDECompilerSettings shall come with the option to have that set 
automatically (take a peek at  https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/144 for related plans)

Cheers
Friedrich





More information about the kde-devel mailing list