rockchip-linux / mpp

Media Process Platform (MPP) module
466 stars 155 forks source link

Fix static build #579

Closed MarcA711 closed 2 months ago

MarcA711 commented 2 months ago

When working with the new static build, I stumbled across two problems:

  1. The current implementation always installs shared and static libraries. This can lead to build errors. It is better to either install the shared or static files.
  2. The current static librochchip_mpp.a lacks most symbols. When using static libraries, the cmake command target_link_libraries will not add the definitions from one static library to another. Therefore to get a fully working static lib, one has to merge all libraries that were created during the build process.

This PR fixes both issues.

nyanmisaka commented 2 months ago

cc @HermanChen The previous commit ec2666f is not sufficient to provide static build support. FFmpeg still complained that it could not find the corresponding symbol during the gcc LD stage. Here's the error logs. https://github.com/MarcA711/Rockchip-FFmpeg-Builds/issues/1

In addition, users cannot choose to build only shared or static builds through Cmake options.

MarcA711 commented 2 months ago

@HermanChen I just pushed a second commit. It should not change the behavior in any way but removes duplicate code and makes everything better readable and maintainable.

The cmake variable MPP_STATIC is not needed anymore as far as I can see. If no other functionality depends on it, I could remove it if you want.

HermanChen commented 2 months ago

Thanks for the patchs. They are merged.