Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyONeal committed Apr 28, 2022
1 parent 7c12aba commit 566b8ff
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions scripts/toolchains/uwp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@ if(NOT _VCPKG_WINDOWS_TOOLCHAIN)
set(_VCPKG_WINDOWS_TOOLCHAIN 1)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<STREQUAL:${VCPKG_CRT_LINKAGE},dynamic>:DLL>" CACHE STRING "")

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(CMAKE_SYSTEM_NAME WindowsStore CACHE STRING "")
else()
set(CMAKE_SYSTEM_NAME Windows CACHE STRING "")
endif()

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(CMAKE_SYSTEM_PROCESSOR x86 CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(CMAKE_SYSTEM_PROCESSOR AMD64 CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(CMAKE_SYSTEM_PROCESSOR ARM CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR ARM64 CACHE STRING "")
endif()

if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION)
set(CMAKE_SYSTEM_VERSION "${VCPKG_CMAKE_SYSTEM_VERSION}" CACHE STRING "" FORCE)
endif()

if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR)
set(CMAKE_CROSSCOMPILING OFF CACHE STRING "")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
# any of the four platforms can run x86 binaries
set(CMAKE_CROSSCOMPILING OFF CACHE STRING "")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ARM64")
# arm64 can run binaries of any of the four platforms after Windows 11
set(CMAKE_CROSSCOMPILING OFF CACHE STRING "")
endif()

if(NOT DEFINED CMAKE_SYSTEM_VERSION)
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}" CACHE STRING "")
endif()
endif()

get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
if(NOT _CMAKE_IN_TRY_COMPILE)

Expand Down

0 comments on commit 566b8ff

Please sign in to comment.