impeller-cmake Example Project
This CMake project compiles parts of Flutter Engine, including Impeller's renderer layer and FML. The Flutter Engine codebase only supports building against Clang.
This repository is tested against the x64 Native Tools Command Prompt for VS 2022
.
This repository is tested against Homebrew Clang 13.0.0, which ships with the homebrew llvm
package.
Note: Don't do this unless you're comfortable with restoring if things go wrong.
# Set a password for the user.
passwd
# Disable filesystem read-only mode.
sudo btrfs property set -ts / ro false
# Install archlinux maintainer public keys.
sudo pacman-key --init
sudo pacman-key --populate archlinux
# Install build dependencies.
sudo pacman -Sy cmake
# The following dependencies should already be installed on the SteamDeck,
# but they need to be reinstalled in order to populate missing headers.
sudo pacman -Sy mesa libglvnd xorgproto libxrandr libxinerama libxcursor libxi libxext gcc linux-api-headers libx11 libxrender libxfixes
-
Clone the repository and fetch submodules:
git clone [email protected]:bdero/impeller-cmake-example.git --recursive
-
Fetch non-submodule dependencies:
cd impeller-cmake-example ./deps.sh
This repository contains configuration to make working with vscode easy out of the box (.vscode/settings.json
and CMakePresets.json
).
Note that ubiquitous tools like cmake
and clangd
do all of the heavy lifting here, and getting a good code completion/navigation experience is possible for any editor with clangd
support (Emacs, Sublime, etc).
-
Get clang:
- Windows: Install Visual Studio 2022 and open the
x64 Native Tools Command Prompt for VS 2022
- macOS: Download LLVM (homebrew:
brew install llvm
)
- Windows: Install Visual Studio 2022 and open the
-
Install recommended vscode extensions:
- CMake Tools (build using CMake presets)
- clangd (accurate code completion and navigation)
-
Open the root directory of this repository in vscode:
code impeller-cmake-example
-
Configure CMake (bottom bar).
- Select the active configure preset:
- Windows:
Ninja Debug VS2022
- macOS:
Ninja Debug
- Windows:
- Set the active build preset to
Example debug
. - Set the default target to
example
.
- Select the active configure preset:
-
Build/debug/run and enjoy!