Hi @malo-rte
cmake pluging does not support cross compilation by default, however for your simple use case you can enable it by simply using own custom make plugin.
Just place following into: snap/plugins/x-cmake.py
import snapcraft
import logging
from snapcraft.plugins import cmake
logger = logging.getLogger(__name__)
class CMakePlugin(snapcraft.plugins.cmake.CMakePlugin):
def enable_cross_compilation(self):
logger.info('Cross compiling to {!r}'.format(self.project.kernel_arch))
def _build_environment(self):
env = super()._build_environment()
if self.project.kernel_arch == 'arm':
env['CC'] = 'arm-linux-gnueabihf-gcc'
env['CXX'] = 'arm-linux-gnueabihf-g++'
return env