Skip to content

Relax Clang frontend variant detection #477

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

silvanshade
Copy link
Contributor

This allows Clang frontend variant detection to work better in more scenarios such as when compiling with cross-compilers with platform prefixes.

In particular this fixes cross-compiles from Linux to FreeBSD for nix packaging.

It would be good to get this in the next patch release but probably isn't critical enough to warrant it's own release since it should only show up when using both Clang and specially named cross-compiler (which is somewhat unusual since Clang already supports multiple targets).

CC @Ericson2314

@BurningEnlightenment
Copy link
Collaborator

Would the cross compiling detection automatically work if we used CMAKE_CXX_COMPILER_FRONTEND_VARIANT?

@BurningEnlightenment BurningEnlightenment self-assigned this Apr 24, 2025
@silvanshade silvanshade force-pushed the relax-cxx-compiler-frontend-detection branch from 6587a21 to cc003cb Compare April 24, 2025 17:07
@silvanshade
Copy link
Contributor Author

Would the cross compiling detection automatically work if we used CMAKE_CXX_COMPILER_FRONTEND_VARIANT?

Yes.

With that in mind I refactored the existing detection code to use CMAKE_CXX_COMPILER_FRONTEND_VARIANT if available and fall back to our re-implementation otherwise.

I also moved the logic into BLAKE3/Utils.cmake which is probably cleaner if you're moving some of the other stuff there in the other PR.

@silvanshade silvanshade force-pushed the relax-cxx-compiler-frontend-detection branch from cc003cb to 46e8003 Compare April 24, 2025 17:09
This allows Clang frontend variant detection to work better in more
scenarios such as when compiling with cross-compilers with platform
prefixes.
@silvanshade silvanshade force-pushed the relax-cxx-compiler-frontend-detection branch from 46e8003 to 89e3bf9 Compare April 24, 2025 17:10
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.

2 participants