From 807a7e939cf453d6c181bee5a3991b00c0aee468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 25 Nov 2020 18:41:23 +0100 Subject: [PATCH] ObjImporter: compile with exceptions enabled on Emscripten. Actually looking forward to when I rewrite this whole thing. --- doc/changelog.dox | 3 +++ src/MagnumPlugins/ObjImporter/CMakeLists.txt | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/doc/changelog.dox b/doc/changelog.dox index a199ba9bf..5b271f52a 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -196,6 +196,9 @@ See also: - Suppressed a warning specific to MinGW GCC 8+ (see [mosra/magnum#474](https://github.com/mosra/magnum/issues/474)) - Linux and Emscripten builds were migrated from Travis to Circle CI +- @ref Trade::ObjImporter "ObjImporter" uses exceptions internally and needs + an explicit exception-enabling flag when built with Emscripten 1.39.0 and + newer @subsection changelog-latest-bugfixes Bug fixes diff --git a/src/MagnumPlugins/ObjImporter/CMakeLists.txt b/src/MagnumPlugins/ObjImporter/CMakeLists.txt index 1fbac5e89..0c63dc95d 100644 --- a/src/MagnumPlugins/ObjImporter/CMakeLists.txt +++ b/src/MagnumPlugins/ObjImporter/CMakeLists.txt @@ -50,6 +50,13 @@ if(CMAKE_RUNTIME_OUTPUT_DIRECTORY AND CMAKE_LIBRARY_OUTPUT_DIRECTORY AND CMAKE_A LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers) endif() +if(CORRADE_TARGET_EMSCRIPTEN) + # Since 1.39.0, this needs to be enabled on the plugin. Before (on 1.38.44 + # at least) this wasn't needed, at least for the test -- having it enabled + # for the test binary and in the linker was enough. Most probably related + # to fastcomp->llvm backend switch. + set_property(TARGET ObjImporter APPEND_STRING PROPERTY COMPILE_FLAGS " -s DISABLE_EXCEPTION_CATCHING=0") +endif() install(FILES ObjImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/ObjImporter)