[Interest] What is the right way of creating a static lib that has qml resources with cmake?
cristian.adam at qt.io
Mon Jan 23 12:11:25 CET 2023
>> Yes, there is. There's -Wl,--whole-archive for the Unix linkers. This should
>> solve the problem for everyone except MSVC users.
> That option is not very attractive because:
> a, as you state yourself, it doesn't work on MSVC.
MSVC also has a /wholearchive<https://learn.microsoft.com/en-us/cpp/build/reference/wholearchive-include-all-library-object-files?view=msvc-170> parameter to the linker.
Starting with CMake 3.24 you can use it generically as:
target_link_libraries(my_exe PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,my_static_lib>")
Fore more details see:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest