Skip to content

Commit cfaca5b

Browse files
committed
Don't try to compile Haswell benchmarks on ARM
1 parent ee5b6c6 commit cfaca5b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

benchmark/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ link_libraries(simdjson-windows-headers test-data)
55
if (TARGET benchmark::benchmark)
66
add_executable(bench_sax bench_sax.cpp)
77
target_link_libraries(bench_sax simdjson-internal-flags simdjson-include-source benchmark::benchmark)
8-
target_compile_options(bench_sax PRIVATE -mavx2 -mbmi -mpclmul -mlzcnt)
8+
# Don't pass all the compiler options on ARM
9+
CHECK_CXX_COMPILER_FLAG(-mavx2 HAVE_MAVX2_FLAG)
10+
if (HAVE_MAVX2_FLAG)
11+
target_compile_options(bench_sax PRIVATE -mavx2 -mbmi -mpclmul -mlzcnt)
12+
# Some ARM compilers "support" -mavx2 but don't use it. This makes them not complain.
13+
CHECK_CXX_COMPILER_FLAG(-Qunused-arguments HAVE_QUNUSED_ARGUMENTS_FLAG)
14+
if (HAVE_QUNUSED_ARGUMENTS_FLAG)
15+
target_compile_options(bench_sax PRIVATE -Qunused-arguments)
16+
endif()
17+
endif()
918
endif (TARGET benchmark::benchmark)
1019

1120
link_libraries(simdjson simdjson-flags)

0 commit comments

Comments
 (0)