sdk: support cmake builds on Windows

CMake and Ninja combination does not support changing RPATH on Windows hosts,
even when cross-compiling. Add CMake configuration to workaround this.

Pick-to: 6.3 6.2
Change-Id: I5d82c0a7f91cf81a0b3ed7c0f14aeccc36464f91
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
This commit is contained in:
Samuli Piippo 2022-03-14 10:53:41 +00:00
parent 3d122c668c
commit 554b947ba4

View File

@ -120,6 +120,10 @@ function(cmake_initialize_per_config_variable _PREFIX _DOCSTRING)
_cmake_initialize_per_config_variable(\${ARGV})
endfunction()
if(CMAKE_HOST_WIN32)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
endif()
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
endif()