Skip to content

Commit c25a6f4

Browse files
committed
Add ARM/ARM64 support for VS builds.
1 parent c6f61d8 commit c25a6f4

File tree

5 files changed

+211
-1
lines changed

5 files changed

+211
-1
lines changed

props/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ There is generally no good reason to change the `.props` files as overrides are
3131

3232
Note that all `.props' files are assumed to be in a common directory, despite the repo structure.
3333

34-
The following combinations are achieved by referencing the desired build configuration (e.g. `DynamicDLL.props`) as shown above.
34+
The following combinations are achieved by referencing the desired build configuration (e.g. `DynamicDLL.props`) as shown above. The same six are also available for ARM/ARM64.
3535

3636
**Dynamic libraries linked dynamically to CRT**
3737
```

props/version4/base/Arm.props

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<PropertyGroup>
5+
<_PropertySheetDisplayName>ARM32 Settings</_PropertySheetDisplayName>
6+
</PropertyGroup>
7+
8+
<ItemDefinitionGroup>
9+
<ClCompile>
10+
<!-- Note that WIN32 and _WIN32 are safe for ARM32 builds and ensure compatibility with
11+
Windows headers, as they imply Windows 32-bit or above. _ARM_ indicates the 32-bit ARM
12+
architecture. -->
13+
<PreprocessorDefinitions>WIN32;_WIN32;_ARM_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
14+
</ClCompile>
15+
<Link>
16+
<TargetMachine>MachineARM</TargetMachine>
17+
</Link>
18+
<Lib>
19+
<AdditionalOptions>/MACHINE:ARM %(AdditionalOptions)</AdditionalOptions>
20+
</Lib>
21+
</ItemDefinitionGroup>
22+
23+
</Project>

props/version4/base/Arm64.props

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<PropertyGroup>
5+
<_PropertySheetDisplayName>ARM64 Settings</_PropertySheetDisplayName>
6+
</PropertyGroup>
7+
8+
<ItemDefinitionGroup>
9+
<ClCompile>
10+
<!-- Note that Win32 defines may cause WIN32 to become defined when using Windows headers,
11+
but _WIN32 implies Windows 32-bit or above. These are safe for ARM64 builds and ensure
12+
compatibility with Windows headers. _ARM64 indicates the ARM64 architecture. -->
13+
<PreprocessorDefinitions>WIN32;_WIN32;_ARM64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
14+
</ClCompile>
15+
<Link>
16+
<TargetMachine>MachineARM64</TargetMachine>
17+
</Link>
18+
<Lib>
19+
<AdditionalOptions>/MACHINE:ARM64 %(AdditionalOptions)</AdditionalOptions>
20+
</Lib>
21+
</ItemDefinitionGroup>
22+
23+
</Project>

templates/gsl.sln

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ EndGlobal
116116
\t\tStaticDebug|x64 = StaticDebug|x64
117117
\t\tStaticRelease|Win32 = StaticRelease|Win32
118118
\t\tStaticRelease|x64 = StaticRelease|x64
119+
\t\tStaticDebug|ARM = StaticDebug|ARM
120+
\t\tStaticDebug|ARM64 = StaticDebug|ARM64
121+
\t\tStaticRelease|ARM = StaticRelease|ARM
122+
\t\tStaticRelease|ARM64 = StaticRelease|ARM64
119123
\tEndGlobalSection
120124
.endmacro emit_presolution
121125
.
@@ -136,6 +140,14 @@ EndGlobal
136140
\t\t{$(my.uuid:upper)}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32
137141
\t\t{$(my.uuid:upper)}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64
138142
\t\t{$(my.uuid:upper)}.StaticRelease|x64.Build.0 = ReleaseLIB|x64
143+
\t\t{$(my.uuid:upper)}.StaticDebug|ARM.ActiveCfg = DebugLIB|ARM
144+
\t\t{$(my.uuid:upper)}.StaticDebug|ARM.Build.0 = DebugLIB|ARM
145+
\t\t{$(my.uuid:upper)}.StaticDebug|ARM64.ActiveCfg = DebugLIB|ARM64
146+
\t\t{$(my.uuid:upper)}.StaticDebug|ARM64.Build.0 = DebugLIB|ARM64
147+
\t\t{$(my.uuid:upper)}.StaticRelease|ARM.ActiveCfg = ReleaseLIB|ARM
148+
\t\t{$(my.uuid:upper)}.StaticRelease|ARM.Build.0 = ReleaseLIB|ARM
149+
\t\t{$(my.uuid:upper)}.StaticRelease|ARM64.ActiveCfg = ReleaseLIB|ARM64
150+
\t\t{$(my.uuid:upper)}.StaticRelease|ARM64.Build.0 = ReleaseLIB|ARM64
139151
.endmacro emit_library_crossproduct
140152
.
141153
.macro emit_binary_crossproduct(uuid)
@@ -147,6 +159,14 @@ EndGlobal
147159
\t\t{$(my.uuid:upper)}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32
148160
\t\t{$(my.uuid:upper)}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64
149161
\t\t{$(my.uuid:upper)}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64
162+
\t\t{$(my.uuid:upper)}.StaticDebug|ARM.ActiveCfg = DebugSEXE|ARM
163+
\t\t{$(my.uuid:upper)}.StaticDebug|ARM.Build.0 = DebugSEXE|ARM
164+
\t\t{$(my.uuid:upper)}.StaticDebug|ARM64.ActiveCfg = DebugSEXE|ARM64
165+
\t\t{$(my.uuid:upper)}.StaticDebug|ARM64.Build.0 = DebugSEXE|ARM64
166+
\t\t{$(my.uuid:upper)}.StaticRelease|ARM.ActiveCfg = ReleaseSEXE|ARM
167+
\t\t{$(my.uuid:upper)}.StaticRelease|ARM.Build.0 = ReleaseSEXE|ARM
168+
\t\t{$(my.uuid:upper)}.StaticRelease|ARM64.ActiveCfg = ReleaseSEXE|ARM64
169+
\t\t{$(my.uuid:upper)}.StaticRelease|ARM64.Build.0 = ReleaseSEXE|ARM64
150170
.endmacro emit_binary_crossproduct
151171
.
152172
.macro emit_solution_properties()

templates/gsl.vcxproj

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,54 @@ endfunction emit_project
505505
<Configuration>ReleaseLIB</Configuration>
506506
<Platform>x64</Platform>
507507
</ProjectConfiguration>
508+
<ProjectConfiguration Include="DebugDEXE|ARM">
509+
<Configuration>DebugDEXE</Configuration>
510+
<Platform>ARM</Platform>
511+
</ProjectConfiguration>
512+
<ProjectConfiguration Include="ReleaseDEXE|ARM">
513+
<Configuration>ReleaseDEXE</Configuration>
514+
<Platform>ARM</Platform>
515+
</ProjectConfiguration>
516+
<ProjectConfiguration Include="DebugDEXE|ARM64">
517+
<Configuration>DebugDEXE</Configuration>
518+
<Platform>ARM64</Platform>
519+
</ProjectConfiguration>
520+
<ProjectConfiguration Include="ReleaseDEXE|ARM64">
521+
<Configuration>ReleaseDEXE</Configuration>
522+
<Platform>ARM64</Platform>
523+
</ProjectConfiguration>
524+
<ProjectConfiguration Include="DebugLEXE|ARM">
525+
<Configuration>DebugLEXE</Configuration>
526+
<Platform>ARM</Platform>
527+
</ProjectConfiguration>
528+
<ProjectConfiguration Include="ReleaseLEXE|ARM">
529+
<Configuration>ReleaseLEXE</Configuration>
530+
<Platform>ARM</Platform>
531+
</ProjectConfiguration>
532+
<ProjectConfiguration Include="DebugLEXE|ARM64">
533+
<Configuration>DebugLEXE</Configuration>
534+
<Platform>ARM64</Platform>
535+
</ProjectConfiguration>
536+
<ProjectConfiguration Include="ReleaseLEXE|ARM64">
537+
<Configuration>ReleaseLEXE</Configuration>
538+
<Platform>ARM64</Platform>
539+
</ProjectConfiguration>
540+
<ProjectConfiguration Include="DebugSEXE|ARM">
541+
<Configuration>DebugSEXE</Configuration>
542+
<Platform>ARM</Platform>
543+
</ProjectConfiguration>
544+
<ProjectConfiguration Include="ReleaseSEXE|ARM">
545+
<Configuration>ReleaseSEXE</Configuration>
546+
<Platform>ARM</Platform>
547+
</ProjectConfiguration>
548+
<ProjectConfiguration Include="DebugSEXE|ARM64">
549+
<Configuration>DebugSEXE</Configuration>
550+
<Platform>ARM64</Platform>
551+
</ProjectConfiguration>
552+
<ProjectConfiguration Include="ReleaseSEXE|ARM64">
553+
<Configuration>ReleaseSEXE</Configuration>
554+
<Platform>ARM64</Platform>
555+
</ProjectConfiguration>
508556
</ItemGroup>
509557
.endmacro emit_item_group_product_configurations_library
510558
.
@@ -565,6 +613,54 @@ endfunction emit_project
565613
<Configuration>ReleaseSEXE</Configuration>
566614
<Platform>x64</Platform>
567615
</ProjectConfiguration>
616+
<ProjectConfiguration Include="DebugDEXE|ARM">
617+
<Configuration>DebugDEXE</Configuration>
618+
<Platform>ARM</Platform>
619+
</ProjectConfiguration>
620+
<ProjectConfiguration Include="ReleaseDEXE|ARM">
621+
<Configuration>ReleaseDEXE</Configuration>
622+
<Platform>ARM</Platform>
623+
</ProjectConfiguration>
624+
<ProjectConfiguration Include="DebugDEXE|ARM64">
625+
<Configuration>DebugDEXE</Configuration>
626+
<Platform>ARM64</Platform>
627+
</ProjectConfiguration>
628+
<ProjectConfiguration Include="ReleaseDEXE|ARM64">
629+
<Configuration>ReleaseDEXE</Configuration>
630+
<Platform>ARM64</Platform>
631+
</ProjectConfiguration>
632+
<ProjectConfiguration Include="DebugLEXE|ARM">
633+
<Configuration>DebugLEXE</Configuration>
634+
<Platform>ARM</Platform>
635+
</ProjectConfiguration>
636+
<ProjectConfiguration Include="ReleaseLEXE|ARM">
637+
<Configuration>ReleaseLEXE</Configuration>
638+
<Platform>ARM</Platform>
639+
</ProjectConfiguration>
640+
<ProjectConfiguration Include="DebugLEXE|ARM64">
641+
<Configuration>DebugLEXE</Configuration>
642+
<Platform>ARM64</Platform>
643+
</ProjectConfiguration>
644+
<ProjectConfiguration Include="ReleaseLEXE|ARM64">
645+
<Configuration>ReleaseLEXE</Configuration>
646+
<Platform>ARM64</Platform>
647+
</ProjectConfiguration>
648+
<ProjectConfiguration Include="DebugSEXE|ARM">
649+
<Configuration>DebugSEXE</Configuration>
650+
<Platform>ARM</Platform>
651+
</ProjectConfiguration>
652+
<ProjectConfiguration Include="ReleaseSEXE|ARM">
653+
<Configuration>ReleaseSEXE</Configuration>
654+
<Platform>ARM</Platform>
655+
</ProjectConfiguration>
656+
<ProjectConfiguration Include="DebugSEXE|ARM64">
657+
<Configuration>DebugSEXE</Configuration>
658+
<Platform>ARM64</Platform>
659+
</ProjectConfiguration>
660+
<ProjectConfiguration Include="ReleaseSEXE|ARM64">
661+
<Configuration>ReleaseSEXE</Configuration>
662+
<Platform>ARM64</Platform>
663+
</ProjectConfiguration>
568664
</ItemGroup>
569665
.endmacro emit_item_group_product_configurations_binary
570666
.
@@ -617,6 +713,54 @@ endfunction emit_project
617713
<ProjectConfiguration Include="ReleaseLIB|x64">
618714
<Configuration>ReleaseLIB</Configuration>
619715
<Platform>x64</Platform>
716+
</ProjectConfiguration>
717+
<ProjectConfiguration Include="DebugDLL|ARM">
718+
<Configuration>DebugDLL</Configuration>
719+
<Platform>ARM</Platform>
720+
</ProjectConfiguration>
721+
<ProjectConfiguration Include="ReleaseDLL|ARM">
722+
<Configuration>ReleaseDLL</Configuration>
723+
<Platform>ARM</Platform>
724+
</ProjectConfiguration>
725+
<ProjectConfiguration Include="DebugDLL|ARM64">
726+
<Configuration>DebugDLL</Configuration>
727+
<Platform>ARM64</Platform>
728+
</ProjectConfiguration>
729+
<ProjectConfiguration Include="ReleaseDLL|ARM64">
730+
<Configuration>ReleaseDLL</Configuration>
731+
<Platform>ARM64</Platform>
732+
</ProjectConfiguration>
733+
<ProjectConfiguration Include="DebugLTCG|ARM">
734+
<Configuration>DebugLTCG</Configuration>
735+
<Platform>ARM</Platform>
736+
</ProjectConfiguration>
737+
<ProjectConfiguration Include="ReleaseLTCG|ARM">
738+
<Configuration>ReleaseLTCG</Configuration>
739+
<Platform>ARM</Platform>
740+
</ProjectConfiguration>
741+
<ProjectConfiguration Include="DebugLTCG|ARM64">
742+
<Configuration>DebugLTCG</Configuration>
743+
<Platform>ARM64</Platform>
744+
</ProjectConfiguration>
745+
<ProjectConfiguration Include="ReleaseLTCG|ARM64">
746+
<Configuration>ReleaseLTCG</Configuration>
747+
<Platform>ARM64</Platform>
748+
</ProjectConfiguration>
749+
<ProjectConfiguration Include="DebugLIB|ARM">
750+
<Configuration>DebugLIB</Configuration>
751+
<Platform>ARM</Platform>
752+
</ProjectConfiguration>
753+
<ProjectConfiguration Include="ReleaseLIB|ARM">
754+
<Configuration>ReleaseLIB</Configuration>
755+
<Platform>ARM</Platform>
756+
</ProjectConfiguration>
757+
<ProjectConfiguration Include="DebugLIB|ARM64">
758+
<Configuration>DebugLIB</Configuration>
759+
<Platform>ARM64</Platform>
760+
</ProjectConfiguration>
761+
<ProjectConfiguration Include="ReleaseLIB|ARM64">
762+
<Configuration>ReleaseLIB</Configuration>
763+
<Platform>ARM64</Platform>
620764
</ProjectConfiguration>
621765
</ItemGroup>
622766
.endmacro emit_item_group_product_configurations_library

0 commit comments

Comments
 (0)