google / google/filament

Build vs Target build passes

Open
#4,874 15 comments 0 reactions 0 assignees View on GitHub
build
Dominant language
C++
Stars
20.5k
Forks
2.3k
Avg merge
2d 14h
Merged PRs (30d)
83

Description

I'm working on a Yocto (Linux) recipe for Filament. This enables any Linux platform (NXP, RaspberryPi, Qualcomm, Renesas, etc) to easily use filament.

The recipe is currently part of my Yocto meta-vulkan layer:
https://github.com/jwinarske/meta-vulkan/blob/jw/filament/recipes-graphics/filament/filament-vk_git.bb

In Yocto / OpenEmbedded (OE) there are _in general_ two build passes: Native and Target

Native is used to generate host side tools that are used during the Target build pass. So no intent for display testing in a Native build pass. The expectation is that tests run on the target architecture (cross compiled).

Building sdl2. sdl2 for Wayland expects some libraries that are not present in the Native build environment, nor is it practical they get added.

Enter CMake variable `FILAMENT_SKIP_SAMPLES`. Using `FILAMENT_SKIP_SAMPLES` and adding minor CMake changes I can build Filament without sdl2 and things dependent on sdl2 (FilamentApp, tests, etc). Keeping in mind Native build is for creating the tools for Target build pass. Branch that builds for Native is here: https://github.com/meta-flutter/filament/tree/yocto
With this branch and mentioned recipe I get a Native package generated that has the required tools for the Target build pass.

Tests should be independent of samples. So it seems there could be an additional flag `FILAMENT_SKIP_TESTS`. Then if either `FILAMENT_SKIP_SAMPLES` or `FILAMENT_SKIP_TESTS` is set sdl2 is built. If both are set, then sdl2 would be skipped, call it a minimal host build, with tools only. This logic would also gate what gets installed in this state. Effectively only host side tools.

If you're okay with me adding `FILAMENT_SKIP_TESTS` and associated logic to support the Native/Target model for Yocto I will create a PR.

Beyond this I would also add minimal CMake logic to support a Mobile build pass for Linux.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.