[KDE/Mac] Regarding building QML modules

René J.V. Bertin rjvbertin at gmail.com
Wed Feb 4 13:48:46 UTC 2015


On Wednesday February 04 2015 12:49:13 Aleix Pol wrote:

Hi Aleix,

> >> I received this bug report [1], I guess this should be figured out. It
> >> suggests using add_library(MODULE) instead of add_library(SHARED) for
> >> QML modules, as they are not meant to be linked to.

I admit I haven't looked at the bug report, but just be aware of one thing. On Linux there is AFAIK no difference other than in the name between a binary made with add_library(MODULE) or add_library(SHARED). On OS X with a stock cmake, there is: they're created using different linker flags (-bundle vs. -dynamiclib IIRC).
As a result, the latter can be loaded as plugins, but the former cannot be used as shared libraries, not even when you give the full path to the linker. There may be other subtle differences (like whether or not unloading is possible after dynamically loading one), but one can use as a general rule that there is no more need to use -bundle on modern OS X versions.

I have no hard opinion on using a lib prefix or not. For plugins it's probably easier not to add one, esp. if the prefix isn't the same on all supported platforms.

R.


More information about the kde-mac mailing list