Skip to content

Fix CXX feature check when try_run compilation fails#2046

Merged
dmah42 merged 2 commits into
google:mainfrom
cnaples79:fix-try-run-check
Oct 2, 2025
Merged

Fix CXX feature check when try_run compilation fails#2046
dmah42 merged 2 commits into
google:mainfrom
cnaples79:fix-try-run-check

Conversation

@cnaples79

@cnaples79 cnaples79 commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Summary

  • treat failed try_run compilations as failures before consulting the run result
  • only add HAVE_* definitions when both compilation succeeds and the probe executable returns 0

Rationale

Changes

  • gate the previously unconditional RUN_* EQUAL 0 check with the corresponding COMPILE_* flag
  • streamline the failure messages so compile errors are always reported when the probe build fails

Fixes #2036

@dmah42 dmah42 merged commit 40b63f0 into google:main Oct 2, 2025
83 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] incorrect logic of checking the return of try_run() in CXXFeatureCheck.cmake when compile fails

2 participants