From 0f46ce82998b2b1cb68f04bef3a097ea850ad453 Mon Sep 17 00:00:00 2001 From: cheneym2 Date: Fri, 8 Nov 2024 11:15:08 -0500 Subject: Fix EHa flag compiler filtering (#5524) The previous attempt to enable Structured Exception Handling in (only) MSVC using the /EHa compiler flag caused trouble with flags defined with Cmake Generator Expressions. These expressions are not fully resolved, and they fail validation checks in check_cxx_compiler_flag(). The previous attempt at applying /EHa to only MVSC involved refactoring a direct call to target_compile_options() with a call to the Slang helper function add_supported_cxx_flags() where an additional MSVC filter was introduced, but the helper also calls check_cxx_compiler_flag() to see if flags are supported. It was okay for /EHa, but not some other flags that ended up getting newly validated. The above issue is fixed by re-implementing the change that added /EHa to only MSVC. This change goes back to adding compiler flags without the helper function with its extra validation, instead using an additional cmake generator expression to apply /EHa only to MSVC. --- tools/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index ef4d17556..2593a60fd 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -276,7 +276,7 @@ if(SLANG_ENABLE_TESTS) EXTRA_COMPILE_DEFINITIONS_PRIVATE $<$:RENDER_TEST_CUDA> $<$:RENDER_TEST_OPTIX> - EXTRA_COMPILE_OPTIONS_PRIVATE /EHa + EXTRA_COMPILE_OPTIONS_PRIVATE $<$:/EHa> OUTPUT_NAME render-test-tool REQUIRED_BY slang-test FOLDER test/tools -- cgit v1.2.3