mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-15 04:47:59 +08:00
WIP [vcpkg] Fix CMAKE_SYSTEM_PROCESSOR with UWP and Linux triplets (#4688)
* [vcpkg] Fix CMAKE_SYSTEM_PROCESSOR Add CMAKE_SYSTEM_PROCESSOR setting under UWP, Linux, and Darwin. If explicitly specified VCPKG_CMAKE_SYSTEM_PROCESSOR in triplet files, CMAKE_SYSTEM_PROCESSOR is set to specified architecture. * [vcpkg-toolchains] Move logic out of vcpkg_configure_cmake and into the toolchains.
This commit is contained in:
parent
35ea46995b
commit
83af530a42
@ -128,13 +128,15 @@ function(vcpkg_configure_cmake)
|
||||
|
||||
if(DEFINED VCPKG_CMAKE_SYSTEM_NAME)
|
||||
list(APPEND _csc_OPTIONS "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}")
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION)
|
||||
set(VCPKG_CMAKE_SYSTEM_VERSION 10.0)
|
||||
endif()
|
||||
endif()
|
||||
if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION)
|
||||
list(APPEND _csc_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}")
|
||||
endif()
|
||||
if(DEFINED VCPKG_CMAKE_SYSTEM_PROCESSOR)
|
||||
list(APPEND _csc_OPTIONS "-DCMAKE_SYSTEM_PROCESSOR=${VCPKG_CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
|
||||
list(APPEND _csc_OPTIONS "-DVCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=ON)
|
||||
|
@ -1,5 +1,10 @@
|
||||
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
|
||||
|
||||
# TODO: This should be replaced with a switch on VCPKG_TARGET_ARCHITECTURE once we know what linux systems "natively" define for each of the targets
|
||||
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}" CACHE STRING "")
|
||||
else()
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "")
|
||||
endif()
|
||||
set(CMAKE_SYSTEM_NAME Linux CACHE STRING "")
|
||||
|
||||
|
@ -1,3 +1,19 @@
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "")
|
||||
endif()
|
||||
|
||||
if(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 "")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(CMAKE_SYSTEM_PROCESSOR AMD64 CACHE STRING "")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(CMAKE_SYSTEM_PROCESSOR X86 CACHE STRING "")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown target architecture: ${VCPKG_TARGET_ARCHITECTURE}")
|
||||
endif()
|
||||
|
||||
get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
|
||||
if(NOT _CMAKE_IN_TRY_COMPILE)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user