Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adds Mac cross compile flags into barretenberg #1954

Merged
merged 4 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang allows us to cross compile on Mac
# so we explicitly specify the arch to the compiler
# If you just select the arch toolchain and are on an
# x86_64, it will compile for x86_64 mac.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64")
endif()
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang allows us to cross compile on Mac
# so we explicitly specify the arch to the compiler
# If you just select the x86_64 toolchain and are on an
# M1/arm64 mac, it will compile for arm64.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64")
endif()
11 changes: 9 additions & 2 deletions circuits/cpp/cmake/toolchains/aarch64-darwin.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64")

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang allows us to cross compile on Mac
# so we explicitly specify the arch to the compiler
# If you just select the arch toolchain and are on an
# x86_64, it will compile for x86_64 mac.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64")
endif()
11 changes: 9 additions & 2 deletions circuits/cpp/cmake/toolchains/x86_64-darwin.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64")

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang allows us to cross compile on Mac
# so we explicitly specify the arch to the compiler
# If you just select the x86_64 toolchain and are on an
# M1/arm64 mac, it will compile for arm64.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64")
endif()