Skip to content

Commit

Permalink
Add ARM64 to new arch templates (#12635)
Browse files Browse the repository at this point in the history
## Description

This PR fixes up the new `cpp-lib` and `cpp-app` templates to support targeting ARM64, and adds ARM64 builds to the CI/PR matrix.

### Type of Change
- New feature (non-breaking change which adds functionality)

### Why
To enable native builds of ARM64

Closes #12633 

### What
Added the proper configurations to 

## Screenshots
N/A

## Testing
Verified the apps build in CI

## Changelog
Should this change be included in the release notes: _yes_

Updated the experimental `cpp-lib` and `cpp-app` templates to support targeting ARM64.
  • Loading branch information
jonthysell committed Jan 25, 2024
1 parent 5217a03 commit 404db90
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 8 deletions.
31 changes: 30 additions & 1 deletion .ado/jobs/cli-init-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ parameters:
configuration: Debug
platform: x86
additionalRunArguments: --no-autolink
- Name: FabricArm64Release
template: cpp-app
configuration: Release
platform: ARM64
additionalRunArguments: --no-autolink --no-deploy
- Name: FabricLibX64Release
template: cpp-lib
configuration: Release
Expand All @@ -32,6 +37,11 @@ parameters:
configuration: Debug
platform: x86
additionalRunArguments:
- Name: FabricLibArm64Release
template: cpp-lib
configuration: Release
platform: ARM64
additionalRunArguments: --no-deploy
- BuildEnvironment: Continuous
Matrix:
- Name: FabricX64Debug
Expand All @@ -53,7 +63,16 @@ parameters:
template: cpp-app
configuration: Release
platform: x86
additionalRunArguments: --no-autolink
- Name: FabricArm64Debug
template: cpp-app
configuration: Debug
platform: ARM64
additionalRunArguments: --no-autolink --no-deploy
- Name: FabricArm64Release
template: cpp-app
configuration: Release
platform: ARM64
additionalRunArguments: --no-autolink --no-deploy
- Name: FabricLibX64Debug
template: cpp-lib
configuration: Debug
Expand All @@ -74,6 +93,16 @@ parameters:
configuration: Release
platform: x86
additionalRunArguments:
- Name: FabricLibArm64Debug
template: cpp-lib
configuration: Debug
platform: ARM64
additionalRunArguments: --no-deploy
- Name: FabricLibArm64Release
template: cpp-lib
configuration: Release
platform: ARM64
additionalRunArguments: --no-deploy
jobs:
- ${{ each config in parameters.buildMatrix }}:
- ${{ if eq(config.BuildEnvironment, parameters.buildEnvironment) }}:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"clang-format.executable": "${workspaceRoot}/node_modules/.bin/clang-format",
"typescript.tsdk": "node_modules\\typescript\\lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"dotnet.defaultSolution": "disable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add ARM64 to new arch templates",
"packageName": "react-native-windows",
"email": "jthysell@microsoft.com",
"dependentChangeType": "patch"
}
16 changes: 10 additions & 6 deletions vnext/templates/cpp-app/windows/MyApp/MyApp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
Expand Down Expand Up @@ -109,8 +111,10 @@
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions vnext/templates/cpp-lib/windows/MyLib/MyLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
Expand Down

0 comments on commit 404db90

Please sign in to comment.