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.

Pick-to: 6.1
Change-Id: I9bd088f317917544ccfeff61fc4ff90f18f0f3d8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Alexandru Croitor 2021-04-13 19:29:45 +02:00
parent 1d59fe368a
commit ed5543475e

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.