Add option for exception catching in wasm
- This MR enables exceptions in wasm builds so that unit tests can print stack traces for uncaught exceptions, instead of just printing
Uncaught (<random number>)
. - Adds
VTK_WEBASSEMBLY_EXCEPTIONS
cmake setting to enable exceptions at compile+link time with-fexceptions
. - This setting will allow the C++ unit tests to print additional stack traces when an uncaught exception is thrown, at the expense of greater binary size and slower execution.
- The
ENABLE_EXCEPTION_CATCHING
option requires a list of functions from which exceptions may be thrown. This commit allows catching exceptions from all functions withDISABLE_EXCEPTION_CATCHING=0
as we cannot know all possible functions that could throw exceptions. - This commit allowed me to identify what went wrong in TestLabeledDataMappers.cxx because of the stack trace. See #19579
Edited by Jaswant Panchumarti (Kitware)