Closed
Description
Background
See: https://flutter.dev/go/windows-arm64
Currently, Windows has the following build layout: build/windows/runner/Release/my_app.exe
This assumes an AMD64 target architecture.
Solution
Windows should be updated to have separate build directories for each target architectures. For example:
build/windows/x64/runner/Release/my_app.exe
Work
Note
This work item does not include targeting Arm64: Arm64 hosts will produce x64 executables.
Targeting Arm64 will be added by #129807
- Update the Flutter Windows app template
- Replace hardcoded x64 with
FLUTTER_TARGET_PLATFORM
CMake variable. IfFLUTTER_TARGET_PLATFORM
is not set, its value should fallback to x64 for backwards compatibility. - Update ephemeral directory path to use the target architecture's subfolder
- Replace hardcoded x64 with
- Update the Flutter tool:
- Update CMake generation to set the target architecture explicitly using
-A x64
- Update CMake build to set the
FLUTTER_TARGET_PLATFORM
CMake variable tox64
- Add a target architecture subfolder to the
ephemeral
directory - Automatically migrate CMake files to match the new app template
- Automatically clean the
build/windows/
directory if it contains builds that used the old layout
- Update CMake generation to set the target architecture explicitly using
- Update the Flutter docs:
- Update documentation that mentions the build output path
- Update the next release's breaking changes