|
|
|
|
@ -79,16 +79,11 @@ if(NOT TARGET OpenGLES3::OpenGLES3)
|
|
|
|
|
IMPORTED_LOCATION ${OPENGLES3_LIBRARY}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# Emscripten needs a special flag to use WebGL 2. CMake 3.13 allows to set |
|
|
|
|
# this via INTERFACE_LINK_OPTIONS, for older versions we modify the global |
|
|
|
|
# CMAKE_EXE_LINKER_FLAGS inside FindMagnum.cmake. |
|
|
|
|
# TODO since 1.39.19 it's possible to use `-sUSE_WEBGL2=1`, which can be |
|
|
|
|
# then passed via target_link_libraries() etc. without requiring CMake |
|
|
|
|
# 3.13: https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#13919-07072020 |
|
|
|
|
# -- change to that once we drop support for older Emscripten versions |
|
|
|
|
if(CORRADE_TARGET_EMSCRIPTEN AND NOT CMAKE_VERSION VERSION_LESS 3.13) |
|
|
|
|
# I could probably use target_link_options() here, but let's be |
|
|
|
|
# consistent with the rest |
|
|
|
|
# Emscripten needs a special flag to use WebGL 2 |
|
|
|
|
if(CORRADE_TARGET_EMSCRIPTEN) |
|
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.13) |
|
|
|
|
message(FATAL_ERROR "CMake 3.13+ is required in order to specify Emscripten linker options") |
|
|
|
|
endif() |
|
|
|
|
set_property(TARGET OpenGLES3::OpenGLES3 APPEND PROPERTY |
|
|
|
|
INTERFACE_LINK_OPTIONS "SHELL:-s USE_WEBGL2=1") |
|
|
|
|
endif() |
|
|
|
|
|