From e2006f4df2486a6bcac760fd6af4cbe330b63d62 Mon Sep 17 00:00:00 2001 From: jongough <2803240+jongough@users.noreply.github.com> Date: Sun, 4 Feb 2024 17:31:24 +1100 Subject: [PATCH] Update to incorporate pull 378 to set correct target architecture for MSVC build --- CMakeLists.txt | 6 +++--- cmake/PluginSetup.cmake | 31 +++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3eb0ea37..46c01381 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- # Frontend2 Author: Jon Gough -# Testplugin(TP) v1.0.291.0 30/12/2023 DD/MM/YYYY format +# Testplugin(TP) v1.0.292.0 0004/02/2024 DD/MM/YYYY format # buildCI:yes useODAPI:yes validateJSON:yes # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -56,9 +56,9 @@ set(LONG_DESCRIPTION "testplugin Plugin is used to test out the ODraw API and de set(VERSION_MAJOR "1") set(VERSION_MINOR "0") -set(VERSION_PATCH "291") +set(VERSION_PATCH "292") set(VERSION_TWEAK "0") -set(VERSION_DATE "30/12/2023") #DD/MM/YYYY format +set(VERSION_DATE "04/02/2024") #DD/MM/YYYY format set(OCPN_MIN_VERSION "ov58") set(OCPN_API_VERSION_MAJOR "1") diff --git a/cmake/PluginSetup.cmake b/cmake/PluginSetup.cmake index a8502c68..552f7a64 100644 --- a/cmake/PluginSetup.cmake +++ b/cmake/PluginSetup.cmake @@ -242,16 +242,27 @@ if(NOT WIN32 AND NOT QT_ANDROID) else(NOT WIN32 AND NOT QT_ANDROID) set(ARCH "x86_64") - if(_wx_selected_config MATCHES "androideabi-qt-arm64") - set(ARCH "arm64") - # android cannot used graphics context is wxWidgets as it does not exist - set(wxUSE_GRAPHICS_CONTEXT 0) - endif(_wx_selected_config MATCHES "androideabi-qt-arm64") - if(_wx_selected_config MATCHES "androideabi-qt-armhf") - set(ARCH "armhf") - # android cannot used graphics context is wxWidgets as it does not exist - set(wxUSE_GRAPHICS_CONTEXT 0) - endif(_wx_selected_config MATCHES "androideabi-qt-armhf") + if(MSVC) + string(TOLOWER "${CMAKE_VS_PLATFORM_NAME}" platform_name) + if(platform_name MATCHES "x64") + set(ARCH "x86_64") + elseif(platform_name MATCHES "arm64") + set(ARCH "arm64") + else() + set(ARCH "x86") + endif() + else() + if(_wx_selected_config MATCHES "androideabi-qt-arm64") + set(ARCH "arm64") + # android cannot used graphics context is wxWidgets as it does not exist + set(wxUSE_GRAPHICS_CONTEXT 0) + endif(_wx_selected_config MATCHES "androideabi-qt-arm64") + if(_wx_selected_config MATCHES "androideabi-qt-armhf") + set(ARCH "armhf") + # android cannot used graphics context is wxWidgets as it does not exist + set(wxUSE_GRAPHICS_CONTEXT 0) + endif(_wx_selected_config MATCHES "androideabi-qt-armhf") + endif() endif(NOT WIN32 AND NOT QT_ANDROID)