Fix and improve building with clang-cl#251
Open
fanc999 wants to merge 4 commits intoebassi:masterfrom
Open
Conversation
clang-cl does not like it if we try to check values of __GNUC__ without first checking whether it is defined, so fix things up here. clang-cl defines _MSC_VER and __clang__ but not __GNUC__.
clang-cl follows some of the compiler flags that are used for GCC, but not all them, so make sure that we don't try to use the compiler flags that it does not understand. Since the Visual Studio headers and libraries that clang-cl uses supported SSE 4.1 for a very long while, even before the inception of clang-cl, always pass in '-msse4.1' in the cflags when we are building with clang-cl (and it is needed, otherwise the build fails).
We can actually turn off the deprecation warnings from the Visual Studio headers that clang-cl uses, so let's do that.
...for SSE and ARM NEON intrinsics, since the __extension__ stuff is supported on clang-cl. Update the error messages accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
This attempts to fix building with
clang-cl(the clang compiler that attempts to be MSVC compatible), by:graphene-macros.hby checking for the existance of__GNUC__before trying to check its value, sinceclang-cldefines_MSC_VERbut not__GNUC__, unlike clang on *NIX.clang-cl, which follows more the ones used on GCC than Visual Studio, and filter out those that aren't supported. Also, force-msse4.1since that is required for bulding the SSE 4.1 code onclang-cl.clang-clutilizes.clang-clfollow the GCC codepath, since__extension__is supported there as well.With blessings, thank you!