-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Adds Mac cross compile flags into barretenberg (#1954)
When fixing #1841 the flags were put in the cmake toolchains file for circuits which does not get inherited by the barretenberg toolchain files.
- Loading branch information
1 parent
d41ae13
commit 3aaf91e
Showing
4 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
circuits/cpp/barretenberg/cpp/cmake/toolchains/aarch64-darwin.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
9 changes: 9 additions & 0 deletions
9
circuits/cpp/barretenberg/cpp/cmake/toolchains/x86_64-darwin.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |