We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4304 - CMake MSVC ARM/ARM64 builds fail
Summary: CMake MSVC ARM/ARM64 builds fail
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.8
Hardware: ARM Windows (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-10 22:31 UTC by Joel Winarske
Modified: 2018-10-10 22:31 UTC (History)
0 users

See Also:


Attachments
build log (13.31 KB, text/plain)
2018-10-10 22:31 UTC, Joel Winarske
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Winarske 2018-10-10 22:31:55 UTC
Created attachment 3361 [details]
build log

When building for MSVC ARM or MSVC ARM64 build fails with error:
C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\corecrt.h(226): fatal error C1189: #error:  Compiling Desktop applications for the ARM platform is not supported.



This is the solution I've come up with for the pthreads4w and PDCurses open source projects.  The other flags are used by version.rc to define the proper machine string.


include (target_arch)

get_target_arch(TARGET_ARCH)

if(${TARGET_ARCH} STREQUAL "ARM")
    add_definitions(-D__PDCURSES_ARCHARM)
    if(MSVC)
        add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1)
    endif()
elseif(${TARGET_ARCH} STREQUAL "ARM64")
    add_definitions(-D__PDCURSES_ARCHARM64)
    if(MSVC)
        add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1)
    endif()
elseif(${TARGET_ARCH} STREQUAL "x86_64")
    add_definitions(-D__PDCURSES_ARCHAMD64)
elseif(${TARGET_ARCH} STREQUAL "x86")
    add_definitions(-D__PDCURSES_ARCHX86)
elseif(${TARGET_ARCH} STREQUAL "x64")
    add_definitions(-D__PDCURSES_ARCHX64)
else()
    MESSAGE(ERROR "\"${TARGET_ARCH}\" not supported in version.rc")
endif()
message(STATUS "Target ................. ${TARGET_ARCH}")