Skip to content

Commit

Permalink
Draft: Fix EHa flag compiler filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
cheneym2 committed Nov 8, 2024
1 parent 64c6cb1 commit eec50c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ 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}")
Expand Down
5 changes: 2 additions & 3 deletions cmake/SlangTarget.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,9 @@ function(slang_add_target dir type)
)
endif()
if(ARG_EXTRA_COMPILE_OPTIONS_PRIVATE)
add_supported_cxx_flags(
target_compile_options(
${target}
PRIVATE
${ARG_EXTRA_COMPILE_OPTIONS_PRIVATE}
PRIVATE ${ARG_EXTRA_COMPILE_OPTIONS_PRIVATE}
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ if(SLANG_ENABLE_TESTS)
EXTRA_COMPILE_DEFINITIONS_PRIVATE
$<$<BOOL:${SLANG_ENABLE_CUDA}>:RENDER_TEST_CUDA>
$<$<BOOL:${SLANG_ENABLE_OPTIX}>:RENDER_TEST_OPTIX>
EXTRA_COMPILE_OPTIONS_PRIVATE /EHa
EXTRA_COMPILE_OPTIONS_PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/EHa>
OUTPUT_NAME render-test-tool
REQUIRED_BY slang-test
FOLDER test/tools
Expand Down

0 comments on commit eec50c7

Please sign in to comment.