diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b26bbcc..f687560 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -166 +166 @@ option( - ON + OFF @@ -167,0 +168,4 @@ option( +if(NOT BUILD_LOADER_WITH_EXCEPTION_HANDLING) + add_definitions(-DXRLOADER_DISABLE_EXCEPTION_HANDLING) + add_definitions(-DJSON_USE_EXCEPTIONS=0) +endif() diff --git a/src/loader/CMakeLists.txt b/src/loader/CMakeLists.txt index fead046..9db503f 100644 --- a/src/loader/CMakeLists.txt +++ b/src/loader/CMakeLists.txt @@ -157,0 +158,5 @@ endif() +# Parent project (Dolphin) builds with -fno-exceptions, but a few loader +# destructors still contain unconditional catch(...) blocks. Re-enable +# exceptions for this target only so those compile. +target_compile_options(openxr_loader PRIVATE -fexceptions) + diff --git a/src/loader/api_layer_interface.cpp b/src/loader/api_layer_interface.cpp index b8f0881..90f5a31 100644 --- a/src/loader/api_layer_interface.cpp +++ b/src/loader/api_layer_interface.cpp @@ -455,0 +456 @@ ApiLayerInterface::~ApiLayerInterface() { +#ifndef XRLOADER_DISABLE_EXCEPTION_HANDLING @@ -456,0 +458 @@ ApiLayerInterface::~ApiLayerInterface() { +#endif @@ -459,0 +462 @@ ApiLayerInterface::~ApiLayerInterface() { +#ifndef XRLOADER_DISABLE_EXCEPTION_HANDLING @@ -465,0 +469 @@ ApiLayerInterface::~ApiLayerInterface() { +#endif