diff options
| author | cheneym2 <acheney@nvidia.com> | 2024-11-05 17:28:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-05 17:28:36 -0500 |
| commit | 4fa76f374c0c35c9c7d186e8addf6861e98baaec (patch) | |
| tree | 0712545f51f15e62b70e89448e251f7d4df19406 /cmake/CompilerFlags.cmake | |
| parent | e22c0b72b8bedb330d8b20e488f6898f6c484187 (diff) | |
Catch all exceptions in render-test (#5495)
Catch all exceptions in render-test
In MSVC, the /EHsc flag is used by default,
it causes only C++ (synchronous) exceptions
to be caught by try/catch blocks.
The /EHa flag can instead be used to catch
both synchronous C++ exceptions as well
as structured asynchronous exceptions
such as those seen in segfaults or other
typical bugs.
Using /EHa allows render-test to not crash
completely if there is a buggy graphics driver in the system.
Issue 5275
Diffstat (limited to 'cmake/CompilerFlags.cmake')
| -rw-r--r-- | cmake/CompilerFlags.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake index cd9021cd0..5558c346b 100644 --- a/cmake/CompilerFlags.cmake +++ b/cmake/CompilerFlags.cmake @@ -16,6 +16,10 @@ function(add_supported_cxx_flags target) endif() foreach(flag ${flags}) + # /EHa enables SEH on Windows, it is not available in Linux. + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + string(REGEX REPLACE "/EHa" "" flag "${flag}") + endif() # remove the `no-` prefix from warnings because gcc doesn't treat it as an # error on its own string(REGEX REPLACE "\\-Wno\\-(.+)" "-W\\1" flag_to_test "${flag}") |
