CMake: Warn if CMAKE_OSX_ARCHITECTURES is set on non-Apple platforms

Change-Id: Icf683f17602ebb5d085f2ee25c1a02cacfb57609
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 834760e85eac93a959d5e9856b5565afaf421ea7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2024-09-13 14:36:44 +02:00 committed by Qt Cherry-pick Bot
parent ea6797fa56
commit 164635e3b0

View File

@ -179,6 +179,11 @@ endfunction()
function(qt_auto_detect_apple)
if(NOT APPLE)
if(CMAKE_OSX_ARCHITECTURES AND NOT QT_NO_SHOW_NON_APPLE_CMAKE_OSX_ARCHITECTURES_WARNING)
message(WARNING
"CMAKE_OSX_ARCHITECTURES is set while targeting a non-Apple platform. This can "
"lead to build failures. Consider reconfiguring with the variable unset.")
endif()
return()
endif()