Skip to content

[Windows] Update the Windows build layout to include the target architecture #129805

Description

@loic-sharma

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

  1. Update the Flutter Windows app template
    1. Replace hardcoded x64 with FLUTTER_TARGET_PLATFORM CMake variable. If FLUTTER_TARGET_PLATFORM is not set, its value should fallback to x64 for backwards compatibility.
    2. Update ephemeral directory path to use the target architecture's subfolder
  2. Update the Flutter tool:
    1. Update CMake generation to set the target architecture explicitly using -A x64
    2. Update CMake build to set the FLUTTER_TARGET_PLATFORM CMake variable to x64
    3. Add a target architecture subfolder to the ephemeral directory
    4. Automatically migrate CMake files to match the new app template
    5. Automatically clean the build/windows/ directory if it contains builds that used the old layout
  3. Update the Flutter docs:
    1. Update documentation that mentions the build output path
    2. Update the next release's breaking changes

Activity

  1. added
    platform-windowsBuilding on or for Windows specifically
    P3Issues that are less important to the Flutter project
    on Jun 29, 2023
  2. changed the title [-][Windows] Update the Windows build layout to include the architecture[/-] [+][Windows] Update the Windows build layout to include the target architecture[/+] on Jun 30, 2023
  3. loic-sharma commented on Jun 30, 2023

    @loic-sharma
    MemberAuthor

    /cc @pbo-linaro as you are working on this

  4. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jun 30, 2023
  5. github-actions commented on Sep 14, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Sep 14, 2023
  7. added
    team-windowsOwned by the Windows platform team
    and removed on Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: desktopRunning on desktopplatform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions