mirror of
https://github.com/love2d/megasource.git
synced 2026-08-12 08:30:59 +02:00
Windows: Fix ARM64 target detection when using -A ARM64,version=... notation.
This commit is contained in:
+7
-4
@@ -31,7 +31,7 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_MEGATEMP_CHECKVAR MSVC_CXX_ARCHITECTURE_ID)
|
||||
endif()
|
||||
# FIXME: Code below also duplicates MEGA_X64 architecture assignment.
|
||||
if(${_MEGATEMP_CHECKVAR} STREQUAL "ARM64")
|
||||
if(${${_MEGATEMP_CHECKVAR}} MATCHES "^ARM64")
|
||||
set(MEGA_ARM64 TRUE)
|
||||
set(MEGA_ARCH ARM64)
|
||||
else()
|
||||
@@ -145,9 +145,12 @@ if(MSVC)
|
||||
else()
|
||||
set(MEGA_MSVC_VCVARSALL_BAT_ARG "-arch=x86")
|
||||
endif()
|
||||
math(EXPR VS_TOOLCHAIN_VERSION_MAJOR "${VSVERSION} / 10")
|
||||
math(EXPR VS_TOOLCHAIN_VERSION_MINOR "${VSVERSION} % 10")
|
||||
set(MEGA_MSVC_VCVARSALL_BAT_ARG "${MEGA_MSVC_VCVARSALL_BAT_ARG} -vcvars_ver=${VS_TOOLCHAIN_VERSION_MAJOR}.${VS_TOOLCHAIN_VERSION_MINOR}")
|
||||
# If we're using MSVC, then the vcvars_ver can be extracted from the MSVC linker version.
|
||||
# If we're somehow using Clang, then it won't work, but it's fine. VsDevCmd will use highest vcvars_ver available.
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" VSVERSION_MATCH ${CMAKE_C_COMPILER_LINKER_VERSION})
|
||||
if(VSVERSION_MATCH)
|
||||
set(MEGA_MSVC_VCVARSALL_BAT_ARG "${MEGA_MSVC_VCVARSALL_BAT_ARG} -vcvars_ver=${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Found vcvarsall.bat")
|
||||
if(MEGA_X86)
|
||||
|
||||
Reference in New Issue
Block a user