Fix linking with `-DOPENMW_USE_SYSTEM_OSG=ON -DOSG_STATIC=ON`
This combination of flags is used by the Android port.
-
CMake's built-in OSG finder does not use pkgconfig, so we have to manually ensure the order is correct for inter-library dependencies.
-
OSG plugin pkgconfig files are missing dependencies on the underlying libraries (e.g. freetype, png, jpeg), so we have to link them manually.
https://github.com/openscenegraph/OpenSceneGraph/issues/1052
-
For
-DOPENMW_USE_SYSTEM_OSG=OFF -DOSG_STATIC=ON
, cleans up the linker command a bit so that the plugins are no longer pased twice (previously: once with--whole-archive
and once without)
/cc @akortunov @thexyz
Edited by Gleb Mazovetskiy