Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EHa flag compiler filtering #5524

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

cheneym2
Copy link
Collaborator

@cheneym2 cheneym2 commented Nov 8, 2024

No description provided.

@cheneym2 cheneym2 requested a review from a team as a code owner November 8, 2024 03:53
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.
@cheneym2 cheneym2 changed the title Draft: Fix EHa flag compiler filtering Fix EHa flag compiler filtering Nov 8, 2024
@cheneym2 cheneym2 added the pr: non-breaking PRs without breaking changes label Nov 8, 2024
Copy link
Collaborator

@jkwak-work jkwak-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@cheneym2 cheneym2 merged commit 0f46ce8 into shader-slang:master Nov 8, 2024
14 checks passed
@cheneym2 cheneym2 deleted the cheneym2/emscripten_build branch November 8, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants