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.

Fixes: #23347

Closes #23355.
This commit is contained in:
Tobias Taschner 2023-03-17 13:32:17 +01:00 committed by Vadim Zeitlin
parent f82bd9ea67
commit 1edb38b548
4 changed files with 47 additions and 9 deletions

View file

@ -112,6 +112,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)
@ -128,8 +147,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