Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions barretenberg/cpp/cmake/arch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ if(WASM)
add_compile_options(-fno-exceptions -fno-slp-vectorize)
endif()

# Auto-detect TARGET_ARCH if not explicitly set.
# Use 'skylake' on x86_64 (matches our cross-compile presets) and 'generic' on ARM
# to avoid emitting CPU-specific instructions (e.g. SVE on Graviton) that break on
# other ARM machines like Apple Silicon.
if(NOT WASM AND NOT TARGET_ARCH)
# Auto-detect TARGET_ARCH for native builds only.
# Cross-compile presets handle arch via zig -target/-mcpu flags; set TARGET_ARCH
# explicitly in the preset if -march is also needed (e.g. arm64-linux uses "generic").
if(NOT WASM AND NOT TARGET_ARCH AND NOT CMAKE_CROSSCOMPILING)
if(ARM)
set(TARGET_ARCH "generic")
else()
Expand Down
Loading