Introduce minimal MSW ARM support

wxMSW could already be compiled for ARM with MSVC, but due to not
defining any ARCH_SUFFIX for ARM, makefile.vc used to place objectsi
and libraries to the same folder as x86 objects and libraries.

A completely different question is what kind of Windows runs on 32-bit
ARM, and whether one can run regular desktop apps on it.

This commit mimics what f69dbaa1 did for ARM64, and adapts it for ARM.

Closes #24222.
This commit is contained in:
Lauri Nurmi 2024-01-15 23:02:16 +02:00 committed by Vadim Zeitlin
parent ed89fc5f3b
commit 99bc43cefe
11 changed files with 94 additions and 4 deletions

View file

@ -37,6 +37,8 @@
<if cond="FORMAT=='msvs2008prj' and MSVS_PLATFORM=='win64'">_x64</if>
<if cond="TARGET_CPU=='amd64'">_x64</if>
<if cond="TARGET_CPU=='AMD64'">_x64</if>
<if cond="TARGET_CPU=='arm'">_arm</if>
<if cond="TARGET_CPU=='ARM'">_arm</if>
<if cond="TARGET_CPU=='arm64'">_arm64</if>
<if cond="TARGET_CPU=='ARM64'">_arm64</if>
<if cond="TARGET_CPU=='ia64'">_ia64</if>
@ -315,6 +317,8 @@
<set var="LINK_TARGET_CPU">
<if cond="TARGET_CPU=='amd64'">/MACHINE:X64</if>
<if cond="TARGET_CPU=='AMD64'">/MACHINE:X64</if>
<if cond="TARGET_CPU=='arm'">/MACHINE:ARM</if>
<if cond="TARGET_CPU=='ARM'">/MACHINE:ARM</if>
<if cond="TARGET_CPU=='arm64'">/MACHINE:ARM64</if>
<if cond="TARGET_CPU=='ARM64'">/MACHINE:ARM64</if>
<if cond="TARGET_CPU=='ia64'">/MACHINE:IA64</if>

View file

@ -111,7 +111,7 @@ your environment is set up appropriately with the correct compiler in the
PATH. Rather it affects some options passed to some of the common build
utilities such as the resource compiler and the linker.
Accepted values: IA64, X64, ARM64
Accepted values: IA64, X64, ARM, ARM64
(AMD64 accepted as synonym for X64 but should not be used any more).
</description>
</option>

View file

@ -135,12 +135,16 @@ set(wxPLATFORM_ARCH)
if(CMAKE_GENERATOR_PLATFORM)
if (CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
set(wxPLATFORM_ARCH "x64")
elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
set(wxPLATFORM_ARCH "arm")
elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64")
set(wxPLATFORM_ARCH "arm64")
endif()
elseif(CMAKE_VS_PLATFORM_NAME)
if (CMAKE_VS_PLATFORM_NAME STREQUAL "x64")
set(wxPLATFORM_ARCH "x64")
elseif(CMAKE_VS_PLATFORM_NAME STREQUAL "ARM")
set(wxPLATFORM_ARCH "arm")
elseif(CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64")
set(wxPLATFORM_ARCH "arm64")
endif()

View file

@ -49,7 +49,7 @@ BUILD = debug
# PATH. Rather it affects some options passed to some of the common build
# utilities such as the resource compiler and the linker.
#
# Accepted values: IA64, X64, ARM64
# Accepted values: IA64, X64, ARM, ARM64
# (AMD64 accepted as synonym for X64 but should not be used any more).
TARGET_CPU = $(CPU)

View file

@ -1873,6 +1873,9 @@ BUILD_CFG_FILE = $(SETUPHDIR)\build.cfg
!if "$(TARGET_CPU)" == "AMD64"
ARCH_SUFFIX = _x64
!endif
!if "$(TARGET_CPU)" == "ARM"
ARCH_SUFFIX = _arm
!endif
!if "$(TARGET_CPU)" == "ARM64"
ARCH_SUFFIX = _arm64
!endif
@ -1891,6 +1894,9 @@ ARCH_SUFFIX = _x64
!if "$(TARGET_CPU)" == "amd64"
ARCH_SUFFIX = _x64
!endif
!if "$(TARGET_CPU)" == "arm"
ARCH_SUFFIX = _arm
!endif
!if "$(TARGET_CPU)" == "arm64"
ARCH_SUFFIX = _arm64
!endif
@ -1942,6 +1948,9 @@ LIBTYPE_SUFFIX = dll
!if "$(TARGET_CPU)" == "AMD64"
LINK_TARGET_CPU = /MACHINE:X64
!endif
!if "$(TARGET_CPU)" == "ARM"
LINK_TARGET_CPU = /MACHINE:ARM
!endif
!if "$(TARGET_CPU)" == "ARM64"
LINK_TARGET_CPU = /MACHINE:ARM64
!endif
@ -1960,6 +1969,9 @@ LINK_TARGET_CPU = /MACHINE:X64
!if "$(TARGET_CPU)" == "amd64"
LINK_TARGET_CPU = /MACHINE:X64
!endif
!if "$(TARGET_CPU)" == "arm"
LINK_TARGET_CPU = /MACHINE:ARM
!endif
!if "$(TARGET_CPU)" == "arm64"
LINK_TARGET_CPU = /MACHINE:ARM64
!endif

View file

@ -29,6 +29,9 @@
<PropertyGroup Label="UserMacros" Condition="'$(Platform)'=='x64'">
<wxArchSuffix>_x64</wxArchSuffix>
</PropertyGroup>
<PropertyGroup Label="UserMacros" Condition="'$(Platform)'=='ARM'">
<wxArchSuffix>_arm</wxArchSuffix>
</PropertyGroup>
<PropertyGroup Label="UserMacros" Condition="'$(Platform)'=='ARM64'">
<wxArchSuffix>_arm64</wxArchSuffix>
</PropertyGroup>