Commit d2ca7ae1 authored by moyo1997's avatar moyo1997
Browse files

added arm64ec msvc support.

parent b30243d9
Pipeline #209376 waiting for manual action with stages
in 25 minutes and 12 seconds
......@@ -116,6 +116,9 @@
# if defined(_M_IA64)
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_ARM64EC)
# define ARCHITECTURE_ID "ARM64EC"
# elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64"
......
......@@ -154,6 +154,8 @@ set(CMAKE_BUILD_TYPE_INIT Debug)
# Compute an architecture family from the architecture id.
foreach(lang C CXX)
set(_MSVC_${lang}_ARCHITECTURE_FAMILY "${MSVC_${lang}_ARCHITECTURE_ID}")
if((_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM64EC") OR (MSVC_ARM64EC))
set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM64EC")
if(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM64")
set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM64")
elseif(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM")
......@@ -224,7 +226,9 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE)
endif()
else()
set(_PLATFORM_DEFINES "/DWIN32")
if(MSVC_ARM64EC)
set(_PLATFORM_DEFINES "${_PLATFORM_DEFINES} /D_AMD64_ /DAMD64 /D_ARM64EC_ /DARM64EC /D_ARM64EC_WORKAROUND_ /arm64EC")
endif()
if(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM")
set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib")
elseif(MSVC_VERSION GREATER 1310)
......@@ -261,6 +265,8 @@ if(MSVC_C_ARCHITECTURE_ID)
set(_MACHINE_ARCH_FLAG "/machine:THUMB")
elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64")
set(_MACHINE_ARCH_FLAG "/machine:ARM64")
elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")
set(_MACHINE_ARCH_FLAG "/machine:ARM64EC")
elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM")
set(_MACHINE_ARCH_FLAG "/machine:ARM")
else()
......@@ -271,6 +277,8 @@ elseif(MSVC_CXX_ARCHITECTURE_ID)
set(_MACHINE_ARCH_FLAG "/machine:THUMB")
elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64")
set(_MACHINE_ARCH_FLAG "/machine:ARM64")
elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")
set(_MACHINE_ARCH_FLAG "/machine:ARM64EC")
elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM")
set(_MACHINE_ARCH_FLAG "/machine:ARM")
else()
......@@ -305,7 +313,10 @@ foreach(t EXE SHARED MODULE)
string(APPEND CMAKE_${t}_LINKER_FLAGS_RELEASE_INIT " /INCREMENTAL:NO")
endforeach()
string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC"))
string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " /machine:ARM64X")
else()
string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
unset(_MACHINE_ARCH_FLAG)
cmake_policy(GET CMP0091 __WINDOWS_MSVC_CMP0091)
......
......@@ -200,6 +200,7 @@ public:
platforms.emplace_back("Win32");
platforms.emplace_back("ARM");
platforms.emplace_back("ARM64");
platforms.emplace_back("ARM64EC");
return platforms;
}
......
......@@ -503,6 +503,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {
{ "TargetMachine", "MACHINE:THUMB", "Machine THUMB", "16", 0 },
{ "TargetMachine", "MACHINE:X64", "Machine x64", "17", 0 },
{ "TargetMachine", "MACHINE:ARM64", "Machine ARM64", "18", 0 },
{ "TargetMachine", "MACHINE:ARM64EC", "Machine ARM64EC", "19", 0 },
{ "TurnOffAssemblyGeneration", "NOASSEMBLY",
"No assembly even if CLR information is present in objects.", "true", 0 },
{ "ModuleDefinitionFile", "DEF:", "add an export def file", "",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment