On Wed, Jan 19, 2022 at 9:56 AM Alexandru Croitor <alexandru.croi...@qt.io>
wrote:

> As far as I know, the referenced merge request only implements an
> abstraction for decorations, but does not implement the specific decoration
> of making sure a library is not discarded.
>

Yes, that's my understanding of the discussion as well. LINK_WHAT_YOU_USE
is supposed to do the right thing, however it's documented for ELF only,
and even then I wasn't able to make it work. That's why I started with the
g++ -u someSymbol  and /INCLUDE:someSymbol instead.

There are WIP changes that try to do that.
> See https://codereview.qt-project.org/c/qt/qtdeclarative/+/367149


Oh, I just took the easy (perhaps wrong) approach. I pushed from the
backing target to the consumer a cpp file, which is a dummy containing the
pointer thing. It just contains (Tsc.Ui is my module's URI):

extern TSCUI_API void qml_register_types_Tsc_Ui();

inline volatile auto tscUiTypeRegistration = &qml_register_types_Tsc_Ui;

I haven't tested it with static libraries, as generally I do avoid them,
but does work for for the shared one (as expected).
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to