[libcamera-devel] Static linking libcamera

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed May 10 07:04:31 CEST 2023


Hi Elias,

On Tue, May 09, 2023 at 08:35:35PM -0600, Elias Naur via libcamera-devel wrote:
> Hi,
> 
> I'd like to build a static binary for Raspberry Pi with libcamera. A
> single static binary
> is much easier to package for an embedded setup than a binary plus its
> transitive
> dependency libraries.
> However, I can't figure out how to do that with libcamera; I tried passing
> --default-library static to meson but that didn't make any difference
> as far as I can tell.

You would need to replace the shared_library() calls in
src/libcamera/meson.build and src/libcamera/base/meson.build with
library().

> Is it possible to static link libcamera? If so, can the IPA loading
> and signature checking
> also be skipped altogether?

No, IPA modules are always loaded at runtime, we don't have the option
to statically link them at this point.

> Currently I patch out the signature
> checking for simplicity
> and to preserve reproducible builds.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list