Fix MSW lib names for ARM64 with CMake build

Any 64 platform had the added _x64 suffix. This will now be _arm64
when building for ARM64.

See #23347, #23355.

(cherry picked from commit 1edb38b54892273f2f932339d49b91f7b60fd3a4)
This commit is contained in:
Tobias Taschner 2023-03-17 13:32:17 +01:00 committed by Vadim Zeitlin
parent bf83403ea7
commit 77db8b7d54
5 changed files with 48 additions and 9 deletions

View File

@ -116,6 +116,25 @@ wx_string_append(wxBUILD_FILE_ID "-${wxMAJOR_VERSION}.${wxMINOR_VERSION}")
wx_get_flavour(lib_flavour "-")
wx_string_append(wxBUILD_FILE_ID "${lib_flavour}")
set(wxPLATFORM_ARCH)
if(CMAKE_GENERATOR_PLATFORM)
if (CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
set(wxPLATFORM_ARCH "x64")
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 "ARM64")
set(wxPLATFORM_ARCH "arm64")
endif()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(wxPLATFORM_ARCH "x64")
endif()
endif()
set(wxARCH_SUFFIX)
set(wxCOMPILER_PREFIX)
set(wxPLATFORM_LIB_DIR)
@ -132,8 +151,8 @@ if(WIN32)
message(FATAL_ERROR "Unknown WIN32 compiler type")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(wxARCH_SUFFIX "_x64")
if(wxPLATFORM_ARCH)
set(wxARCH_SUFFIX "_${wxPLATFORM_ARCH}")
endif()
endif()

View File

@ -12,10 +12,10 @@ function(wx_webview_copy_webview2_loader target)
return()
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(WEBVIEW2_ARCH x86)
if(wxPLATFORM_ARCH)
set(WEBVIEW2_ARCH ${wxPLATFORM_ARCH})
else()
set(WEBVIEW2_ARCH x64)
set(WEBVIEW2_ARCH x86)
endif()
add_custom_command(TARGET ${target} POST_BUILD

View File

@ -65,8 +65,8 @@ if(MSVC OR MINGW OR CYGWIN)
else()
set(wxREQUIRED_OS_DESC "Windows Vista / Windows Server 2008")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
wx_string_append(wxREQUIRED_OS_DESC " (x64 Edition)")
if(wxPLATFORM_ARCH)
wx_string_append(wxREQUIRED_OS_DESC " (${wxPLATFORM_ARCH} Edition)")
endif()
elseif(APPLE AND NOT IPHONE)
if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)

View File

@ -10,8 +10,27 @@ if(WIN32 AND NOT CYGWIN AND NOT MSYS)
set(wxCOMPILER_PREFIX "clang")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(wxARCH_SUFFIX "_x64")
set(wxPLATFORM_ARCH)
if(CMAKE_GENERATOR_PLATFORM)
if (CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
set(wxPLATFORM_ARCH "x64")
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 "ARM64")
set(wxPLATFORM_ARCH "arm64")
endif()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(wxPLATFORM_ARCH "x64")
endif()
endif()
if(wxPLATFORM_ARCH)
set(wxARCH_SUFFIX "_${wxPLATFORM_ARCH}")
endif()
# use wxWidgets_USE_STATIC to force static libraries, otherwise shared is searched first

View File

@ -377,6 +377,7 @@ wxMSW:
- Avoid errors when including wx/msw/msvcrt.h before other wx headers (#23194).
- Fix drawing owner-drawn menu items with bitmaps (Jacob Gillespie, #23230).
- Improve ScrollTo() with wxDV_VARIABLE_LINE_HEIGHT (Jens Göpfert, #23102).
- Fix libraries names in Arch64 CMake build (Tobias Taschner, #23347).
wxOSX: