I searched whole forum and I saw several topics about this question. Some are posted on 2017, I think they are outdated. So I open a new topic about it.
I found several options about cross compile as follows.
- remote build.
This is not what I want because I do not want my code open public to other people. - Set up a buildroot project.
Everything will be compiled from source. It is not what I want. Source may have a different version compared to ubuntu uses. - build on raspi 3
This is not possible because not every one has raspi.
I use architectures option, but that no help. It still use host gcc to compile rather than gcc-arm-linux-gnueabi
Here is my yaml:
name: my-snap-name # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
apps:
hello-world-cli:
command: hello
architectures:
- build-on: amd64
run-on: armhf
parts:
cli:
plugin: cmake
source: https://github.com/ubuntu-core/snapcraft-examples.git
source-subdir: 01-hello-world-cli/src
Is there an easy way to do this? Or can anyone tell me how remote-build is implemented?