Skip to content

Commit 8ba011d

Browse files
committed
fix building with FORCE_AVX2 for apple m chips
1 parent 847fdfb commit 8ba011d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cpp/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@ if (FORCE_AVX2)
5050
-ftree-vectorizer-verbose=0
5151
)
5252
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
53-
target_compile_options(
54-
compile-options
55-
INTERFACE -O2
56-
-mavx2
57-
-mfma
58-
-fpic)
53+
target_compile_options(compile-options INTERFACE -O2 -fpic)
54+
55+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
56+
target_compile_options(compile-options INTERFACE -mavx2 -mfma)
57+
endif()
5958
elseif(MSVC)
6059
target_compile_options(
6160
compile-options

0 commit comments

Comments
 (0)