> On Dec 19, 2017, at 5:39 AM, René J.V. Bertin <rjvber...@gmail.com> wrote:
> 
> Hi,
> 
> Building Qt 5.9.3 I caught a couple of linker warnings about it being unsafe 
> to use dylib with application extensions. Figuring out the source of that I 
> found a remark that "Qt libraries have to use only APIs that are safe to use 
> for application extensions". This despite the fact that I'm not getting a 
> build that's App Store compatible (which I wouldn't want anyway).
> 
> Is there a post somewhere about why Qt libraries have to be built that way 
> and what it implies in practice (if you just want to be able to build and run 
> cross-platform FOSS software including KDE/KF5)?
> 
> I see the `CONFIG += app_extension_api_only` line appearing in a number of 
> mkspecs/*.prf files which suggests that the setting *might* be applied to 
> user projects too (like when building a Qt plugin).
> 
> Is there any risk to commenting those lines out before building Qt, following 
> the principle of "don't use compiler options that you do not understand fully 
> and/or do not really need"?

What about the principle of "don't remove compiler options that you do not 
understand fully and/or may need"? ;)

Leave these alone; do not change them. All this does it makes it into a 
compiler error to use an API *within Qt libraries themselves* that would make 
such libraries incompatible with an App Extension environment. Since the 
developers of Qt are the ones who decide which APIs Qt uses, only the 
developers of Qt should be adding or removing this flag; users have no need to 
ever touch it unless they're forking Qt. There's actually only a very small 
amount of APIs incompatible with app extensions anyways (and primarily on iOS) 
so for the most part the warnings are harmless.

The philosophy is this: you should always build LIBRARIES (or App Extensions 
themselves, which is a logical requirement) with CONFIG+=app_extension_api_only 
so that anyone - regular apps OR extensions - can use them, unless you 
understand why you don't want it. For APPLICATIONS you do not want 
CONFIG+=app_extension_api_only.

It's perfectly OK for an app/library WITHOUT app_extension_api_only to depend 
on a library WITH app_extension_api_only, but obviously not the reverse.

That said, I'd like to know exactly WHERE you're seeing these errors. If 
they're coming from third party dependencies like libpng, etc., then those 
dependencies should be built with -fapplication-extension in order to get rid 
of the warnings. Otherwise they can be safely ignored because there's no way 
anything coming from a KDE/KF5 environment is using any App Extension unsafe 
APIs anyways.

It's slightly unfortunate the way this flag works, because it requires the 
whole world to declare its status. I wish they'd done it in a slightly more 
backwards incompatible way and required modules to explicitly state that they 
are NOT app extension safe instead of the other way around.

> Thanks,
> R.
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
Jake Petroules - jake.petrou...@qt.io
The Qt Company - Silicon Valley
Qbs build tool evangelist - qbs.io

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to