Add msvc flag definition for ARM64

This commit is contained in:
Marek Roszko 2021-03-10 21:43:41 -05:00
parent 56c4c845e8
commit db1f457ff9
2 changed files with 28 additions and 6 deletions

View File

@ -239,12 +239,34 @@ if( WIN32 )
# _USE_MATH_DEFINES is set.
add_definitions( -D_USE_MATH_DEFINES )
# We need the arch for the resource compiler later
if ( NOT CMAKE_SIZEOF_VOID_P EQUAL 8 )
set( KICAD_BUILD_ARCH "x86" )
elseif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set( KICAD_BUILD_ARCH "x64" )
if( MSVC )
if("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "ARM64")
set( KICAD_BUILD_ARCH "arm64" )
set( KICAD_BUILD_ARCH_ARM64 1 )
elseif("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "ARM")
set( KICAD_BUILD_ARCH "arm" )
set( KICAD_BUILD_ARCH_ARM64 1 )
elseif("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "X86")
set( KICAD_BUILD_ARCH "x86" )
set( KICAD_BUILD_ARCH_X86 1 )
elseif("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "x64")
set( KICAD_BUILD_ARCH "x64" )
set( KICAD_BUILD_ARCH_X64 1 )
else()
message(FATAL_ERROR "Failed to determine the MSVC target architecture: ${MSVC_C_ARCHITECTURE_ID}")
endif()
else()
if ( NOT CMAKE_SIZEOF_VOID_P EQUAL 8 )
set( KICAD_BUILD_ARCH "x86" )
set( KICAD_BUILD_ARCH_X86 1 )
elseif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set( KICAD_BUILD_ARCH "x64" )
set( KICAD_BUILD_ARCH_X64 1 )
endif()
endif()
add_definitions( -DKICAD_BUILD_ARCH=${KICAD_BUILD_ARCH} )
if( KICAD_WIN32_DPI_AWARE )

View File

@ -17,13 +17,13 @@ if( MSVC )
enable_language(ASM_MASM)
if( NOT LIBCONTEXT_USE_WINFIBER )
if ( NOT CMAKE_SIZEOF_VOID_P EQUAL 8 )
if ( KICAD_BUILD_ARCH_X84 )
set( CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /safeseh" )
list(APPEND LIBCONTEXT_SOURCES
make_i386_ms_pe_masm.asm
jump_i386_ms_pe_masm.asm
)
elseif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
elseif( KICAD_BUILD_ARCH_X64 )
list(APPEND LIBCONTEXT_SOURCES
make_x86_64_ms_pe_masm.asm
jump_x86_64_ms_pe_masm.asm