The Flutter embedder for Tizen.
- Linux (x64)
- depot_tools
- LLVM (10 or later)
sudo apt install clang-12
- Additional dependencies
sudo apt install git python3 python3-pip rpm2cpio cpio
sudo apt install binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu binutils-i686-linux-gnu
pip3 install requests
-
Create an empty directory called
embedder
andcd
into it. -
Create a
.gclient
file by running:gclient config --name=src --unmanaged https://github.com/flutter-tizen/embedder
-
Run
gclient sync
to fetch all the source code and dependencies.Note:
gclient sync
must be run every time theDEPS
file (or thegenerate_sysroot.py
script) is updated.
cd
into the generated src
directory and run the following commands.
Note: The toolchain path (/usr/lib/llvm-12
) can be replaced as you want. For example, you can use ~/tizen-studio/tools/llvm-10
if you have Tizen Studio and the NativeToolchain-Gcc-9.2
package installed.
-
For arm
tools/gn --target-cpu arm --target-toolchain /usr/lib/llvm-12 ninja -C out/tizen_arm
-
For arm64
tools/gn --target-cpu arm64 --target-toolchain /usr/lib/llvm-12 ninja -C out/tizen_arm64
-
For x86
tools/gn --target-cpu x86 --target-toolchain /usr/lib/llvm-12 ninja -C out/tizen_x86
- To build an app (TPK) with the embedder generated in the above, copy the output artifacts (
libflutter_tizen*.so
) into the flutter-tizen tool's cached artifacts directory (flutter/bin/cache/artifacts/engine
) and runflutter-tizen run
orflutter-tizen build tpk
. - To use the target device's
libstdc++.so
instead of the embedder's built-in libc++ (third_party/libcxx
), provide the--system-cxx
option totools/gn
. Tizen 5.5'slibstdc++.so
is not compatible with C++17 so you must use a sysroot for Tizen 6.0 or above. - Building NUI-related code requires a sysroot for Tizen 6.5 or above and the
--api-version 6.5
option.
This repository contains the following files and directories.
//build
config
: Contains GN configs for setting up the build environment for the toolchain.secondary
: The secondary source tree to find input files for build. See the.gn
file for details.
//flutter
fml
: A subset of the Flutter engine's fml library.shell/platform/common
: Contains C++ client wrapper and other common code used by the embedder implementation. Copied from flutter/engine.shell/platform/embedder
: Containsembedder.h
which defines a low-level API for interacting with the Flutter engine. Copied from flutter/engine.shell/platform/tizen
: The Tizen embedder implementation.channels
: Internal plugins based on platform channels.public
: The public API of the embedder.
third_party/accessibility
: A fork of the chromium accessibility library. Copied from flutter/engine.
//tools
check_symbols.py
: A script to check whether the build artifacts contain symbols not defined in the allowlist. Used by continuous integration.download_engine.py
: A script to download engine artifacts required for linking. Executed as a hook bygclient sync
. The downloaded artifacts can be found in//engine
.generate_sysroot.py
: A script to generate Tizen sysroots for arm/arm64/x86. Executed as a hook bygclient sync
. The sysroots are by default generated in//sysroot
.gn
: A script to automate runninggn gen
.
.gn
: The top-level.gn
file referenced bygn
.DEPS
: The DEPS file used bygclient sync
to install dependencies and execute hooks.