Allow CMAKE_SYSTEM_VERSION to be set without CMAKE_SYSTEM_NAME
Teach CMakeDetermineSystem to check for a CMAKE_SYSTEM_VERSION setting even when CMAKE_SYSTEM_NAME is not set. This will allow builds on the host OS to target other versions of the OS without full cross-compiling.
This commit is contained in:
parent
7068860941
commit
b31ac171a4
@ -12,6 +12,13 @@ then ``CMAKE_SYSTEM_VERSION`` is by default set to the same value as the
|
|||||||
:variable:`CMAKE_HOST_SYSTEM_VERSION` variable so that the build targets
|
:variable:`CMAKE_HOST_SYSTEM_VERSION` variable so that the build targets
|
||||||
the host system version.
|
the host system version.
|
||||||
|
|
||||||
|
In the case of a host build then ``CMAKE_SYSTEM_VERSION`` may be set
|
||||||
|
explicitly when first configuring a new build tree in order to enable
|
||||||
|
targeting the build for a different version of the host operating system
|
||||||
|
than is actually running on the host. This is allowed and not considered
|
||||||
|
cross compiling so long as the binaries built for the specified OS version
|
||||||
|
can still run on the host.
|
||||||
|
|
||||||
System Version for Cross Compiling
|
System Version for Cross Compiling
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
@ -123,7 +123,9 @@ elseif(CMAKE_VS_WINCE_VERSION)
|
|||||||
set(PRESET_CMAKE_SYSTEM_NAME TRUE)
|
set(PRESET_CMAKE_SYSTEM_NAME TRUE)
|
||||||
else()
|
else()
|
||||||
set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
|
set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
|
||||||
|
if(NOT DEFINED CMAKE_SYSTEM_VERSION)
|
||||||
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
|
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
|
||||||
|
endif()
|
||||||
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||||
set(CMAKE_CROSSCOMPILING FALSE)
|
set(CMAKE_CROSSCOMPILING FALSE)
|
||||||
set(PRESET_CMAKE_SYSTEM_NAME FALSE)
|
set(PRESET_CMAKE_SYSTEM_NAME FALSE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user