From b45d5cf566d876157ea3cfdef0cf04413d240433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 4 Sep 2023 20:18:54 +0200 Subject: [PATCH] Platform: put common Emscripten CMake code together. --- src/Magnum/Platform/CMakeLists.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 95d3e1a53..dd481b163 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -182,6 +182,19 @@ if(MAGNUM_WITH_ANDROIDAPPLICATION) add_library(Magnum::AndroidApplication ALIAS MagnumAndroidApplication) endif() +# JavaScript and CSS stuff for Emscripten. Installed unconditionally so it can +# be also used by people who hate the Application classes +if(CORRADE_TARGET_EMSCRIPTEN) + set(MagnumEmscriptenApplication_FILES + EmscriptenApplication.js + WindowlessEmscriptenApplication.js + WebApplication.css) + + list(APPEND MagnumPlatform_FILES ${MagnumEmscriptenApplication_FILES}) + install(FILES ${MagnumEmscriptenApplication_FILES} DESTINATION ${MAGNUM_DATA_INSTALL_DIR}) +endif() + +# Emscripten-specific nightmares for EmscriptenApplication and Sdl2Application if(CORRADE_TARGET_EMSCRIPTEN AND (MAGNUM_WITH_EMSCRIPTENAPPLICATION OR MAGNUM_WITH_SDL2APPLICATION)) # This could also set -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 # always and require only 1.38.27 (where this option got added), but that @@ -360,18 +373,6 @@ if(MAGNUM_WITH_SDL2APPLICATION) add_library(Magnum::Sdl2Application ALIAS MagnumSdl2Application) endif() -# JavaScript and CSS stuff for Emscripten. Installed unconditionally so it can -# be also used by people who hate the Application classes -if(CORRADE_TARGET_EMSCRIPTEN) - set(MagnumEmscriptenApplication_FILES - EmscriptenApplication.js - WindowlessEmscriptenApplication.js - WebApplication.css) - - list(APPEND MagnumPlatform_FILES ${MagnumEmscriptenApplication_FILES}) - install(FILES ${MagnumEmscriptenApplication_FILES} DESTINATION ${MAGNUM_DATA_INSTALL_DIR}) -endif() - # GLX application if(MAGNUM_WITH_GLXAPPLICATION) if(NOT MAGNUM_TARGET_GL)