Compiling Kodi terminates with oom

there is a good guide from Kodi: https://github.com/xbmc/xbmc/blob/master/docs/README.Ubuntu.md.
with minor adaptations it runs on Librem5.

compiling breaks on L5 at building CXX object(s) with out-of-memory at about 50%, having stuff like uPNP disabled. i (de-)selected features to a minimum.
restarting build process starts again at 0%. it’s not e.g. fixing missing dependencies and restart.

kodi’s configure/build/install scripts detect the environment arm64, amd64, etc.
on all supported (linux) platforms the build command for Wayland & OpenGL embedded Systems is:
$> cmake …/kodi -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=wayland -DAPP_RENDER_SYSTEM=gles

so, i have to cross-compile on my notebook with enough memory.

on my notebook i need to tell cmake the target environment arm64 and it also needs to know the target filesystem layout to install into!
Here i am lost!

Any help much appreciated!