-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build native macOS arm binaries (#541)
- Loading branch information
1 parent
74a76a8
commit 4f7946b
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# build-macOS-arm64 | ||
|
||
set(CMAKE_SYSTEM_NAME Darwin) | ||
set(CMAKE_SYSTEM_PROCESSOR arm64) | ||
|
||
set(ZITI_BUILD_TESTS OFF CACHE BOOL "" FORCE) | ||
|
||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64") | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64") | ||
|
||
# for libsodium | ||
set(triple arm64-apple-macos11) | ||
execute_process(COMMAND /usr/bin/xcrun -sdk macosx --show-sdk-path | ||
OUTPUT_VARIABLE CMAKE_OSX_SYSROOT | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
|
||
set(ENV{CFLAGS} "-arch arm64 -isysroot ${CMAKE_OSX_SYSROOT}") | ||
set(ENV{LDFLAGS} "-arch arm64 -isysroot ${CMAKE_OSX_SYSROOT}") | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) |