[Support] [BLAKE3] Fix compilation with CMAKE_OSX_ARCHITECTURES
With CMake, one can build for multiple macOS architectures at the same time by setting CMAKE_OSX_ARCHITECTURES to multiple architectures (avoiding needing to do two separate builds and gluing the binaries together after the build). In this case, while targeting x86_64 and arm64, neither IS_X64 nor IS_ARM64 is set, while compilation of the individual source files will hit those cases (in either architecture mode). Therefore, if we on the CMake level decide not to include the architecture specific SIMD implementation files, also tell the source this explicitly by passing the defines indicating that we don't expect to use them. Such a build clearly is less ideal than explicitly targeting one architecture at a time if it won't include all the SIMD optimizations, but that's a tradeoff that is up to the one deciding to do such an universal build. This also fixes builds for i386. The blake3 source code automatically enables the SIMD implementations when building for i386, but we don't provide the sources for that build configuration. Differential Revision: https://reviews.llvm.org/D122884
Loading
Please sign in to comment