CMake: Fix hardcoded iOS SDK when finding OpenGLES

The find script checked for UIKIT which is set during a Qt build
in QtPlaformSupport.cmake but is not set when building a user project.
This casused the find script to skip the iOS specific code that
passed the -framework OpenGLES linker flag.

This broke SDK switching in Xcode.

Check the IOS variable instead which is set by CMake for all projects
that pass -DCMAKE_SYSTEM_NAME=iOS.

Change-Id: I9bd088f317917544ccfeff61fc4ff90f18f0f3d8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ed5543475e614cc1b1eb3fbee6a635805bb6c805)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2021-04-13 19:29:45 +02:00 committed by Qt Cherry-pick Bot
parent c735d03d44
commit 0ba9a4f832

View File

@ -60,9 +60,9 @@ find_package_handle_standard_args(GLESv2 DEFAULT_MSG ${package_args})
mark_as_advanced(${package_args})
if(GLESv2_FOUND AND NOT TARGET GLESv2::GLESv2)
if(EMSCRIPTEN OR UIKIT)
if(EMSCRIPTEN OR IOS)
add_library(GLESv2::GLESv2 INTERFACE IMPORTED)
if(UIKIT)
if(IOS)
# For simulator_and_device builds we can't specify the full library path, because
# it's specific to either the device or the simulator. Resort to passing a link
# flag instead.