New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build vs Target build passes #4874
Comments
You could build only what you need. For instance our Android builds only compile the following targets on the host: |
I understand your point of building target of interest opposed to The only caveat is if you set FILAMENT_SUPPORT_WAYLAND (PR waiting on your review) sdl2 will fail if required packages are not present. sdl2 will fail without these, so there needs to be a way to gate this in the first place. So by skipping the build of sdl2 it would enable individual target builds as you suggest. |
sdl2 shouldn't be built if all you're building are host tools. Do you need to build Filament itself in what you call the native build? |
Filament only for Target build pass (cross compile). For sdl2 deps there are the samples, and a couple tests. I just don't think gating tests with |
Ok then just build the tools and sdl2 shouldn't be built in the native pass (since you won't build the samples nor Filament and its tests). |
When CMake is run it will run sdl2 tnt cmake where it fails to find dependent packages. Regardless if sdl2 is actually built. Two options:
After that the remainder is cmake logic to enable mobile build pass for linux. |
Ah, see that's exactly why I was commenting in your PR that we don't like using external CMake files and use our own even for dependencies instead. |
In the case of my current open PR, in order to build/link sdl2 it requires system specific packages. I would agree in case of non-system libraries. |
And that's fine but can't we have those dependencies be checked/required only when sdl2 is actually built? |
It would involve custom steps with dependencies. In my opinion messy and not fun to maintain. The change without proposed |
|
I'm good with renaming proposed |
So I have a working Yocto recipe. It only targets Vulkan. jwinarske/meta-vulkan#2 There are two recipes:
These artifacts can also be added to a SDK build, which is used for host cross compilation. Implementing target demos would require quite a bit more work. I may create a separate repo for this later. Filament changes are here: meta-flutter@a4b3bc9 These are based on the Vulkan Wayland PR. Once that gets merged I will submit new PR for the changes to support Yocto. |
Those changes look reasonable. |
I went ahead and created a separate filament-samples repo and associated Yocto recipes. With this I can build all the samples with Vulkan Wayland Backend cross-compiled for target (any machine type), and install into Wayland based OS image. Master can be diffed with https://github.com/jwinarske/filament-samples to see the scope. It is a first pass, it builds, and I suspect it could be improved. If there is an appetite to pull this functionality into master I'm up for it. Yocto recipe for Wayland based image: filament-vk-native -> builds host tools |
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
. UsingFILAMENT_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/yoctoWith 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 eitherFILAMENT_SKIP_SAMPLES
orFILAMENT_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.
The text was updated successfully, but these errors were encountered: