filament icon indicating copy to clipboard operation
filament copied to clipboard

Option to enable Shared libraries build

Open Meakk opened this issue 6 years ago • 5 comments

I have created the AUR package filament (https://aur.archlinux.org/packages/filament/) in order to make access to the library for Arch users.

Since it makes more sense to have shared libraries for a distribution package, I would like to use CMake option BUILD_SHARED_LIBS to build shared libraries.

I'm wondering if there is a reason why all libraries are explicitly forced to static build?
Without STATIC keyword in add_library, CMake is building static library anyway.

Meakk avatar Apr 05 '19 08:04 Meakk

@pixelflinger

romainguy avatar Apr 09 '19 23:04 romainguy

One of our goals is to produce small binaries on Android and static libraries help a lot there. We've had a couple of requests for shared libraries so this is something we could add support for. If you know how to do it properly at the CMake level btw your help would be greatly appreciated.

romainguy avatar Jan 05 '20 19:01 romainguy

I have struggled with this for a few weeks and while the libraries themselves build as shared, unfortunately I may have to leave this to others perhaps more familiar with the filament build scripts.

Relative to dynamic linking, static linking times are much longer, possibly prohibitive.

100espressos avatar Jan 30 '21 18:01 100espressos

yes I'd really like to be able to do that.

pixelflinger avatar Aug 16 '22 20:08 pixelflinger

It should help to know that in some or many cases, the dynamic linking code was deleted for Filament and can be found in the original cmake files.

100espressos avatar Feb 07 '23 19:02 100espressos