- Linux host machine
- Tizen (armv7l) device
- Build dependencies (Ubuntu 20.04)
sudo apt install texinfo bison flex python libncurses5
- Visual Studio Code (optional)
- This is a recommended IDE for browsing the source code.
-
The engine has dependencies on various third party modules. Building the engine requires all their source code to be synced.
-
Follow the instructions in Setting up the Engine development environment.
-
The directory structure after running
gclient sync
should look like this.src (flutter/buildroot) ├── build ├── flutter (<user>/engine) ├── third_party │ ├── dart (https://dart.googlesource.com/sdk.git) │ ├── skia (https://skia.googlesource.com/skia.git) │ ├── icu (https://chromium.googlesource.com/chromium/deps/icu.git) │ └── ... └── ...
-
We'll use a clang cross compiler to build the engine binary. The GBS build is not supported at the moment.
-
Build clang from source.
$ git clone https://github.com/llvm/llvm-project.git --depth 1 $ cd llvm-project $ mkdir build && cd build $ cmake ../llvm -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=<target path>/toolchain \ -DLLVM_DEFAULT_TARGET_TRIPLE=armv7l-tizen-linux-gnueabi \ -DLLVM_TARGETS_TO_BUILD=ARM $ make -j4 $ make install
-
Build binutils from source.
$ git clone git://sourceware.org/git/binutils-gdb.git --depth 1 $ cd binutils-gdb $ ./configure --prefix=<target path>/toolchain \ --enable-gold \ --enable-ld \ --target=armv7l-tizen-linux-gnueabi $ make -j4 $ make install
Clean the entire repo and try again if anything goes wrong.
-
Build the sysroot.
-
(Temporary patch) Add Tizen-specific fonts to Linux default font families.
./flutter/third_party/txt/src/txt/platform_linux.cc
std::vector<std::string> GetDefaultFontFamilies() { - return {"Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", "Arial"}; + return {"SamsungOneUI", "BreezeSans", "Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", "Arial"}; }
-
Set up the build with gn. (Use
--runtime-mode debug
for debug build.)./flutter/tools/gn \ --target-os linux \ --linux-cpu arm \ --target-toolchain <toolchain path> \ --target-sysroot <sysroot path> \ --target-triple armv7l-tizen-linux-gnueabi \ --runtime-mode release \ --embedder-for-target \ --disable-desktop-embeddings
-
Run the ninja build.
ninja -C out/linux_release_arm