fix compile & link on macOS
Some checks are pending
/ build_macos (push) Waiting to run
/ build_windows (push) Waiting to run
/ Central Controller Build (push) Waiting to run
/ multi-arch-docker (push) Blocked by required conditions
/ build_ubuntu (push) Waiting to run

This commit is contained in:
Grant Limberg 2025-09-06 15:02:59 -07:00
parent 36219c59ae
commit a78ac17d10
No known key found for this signature in database
GPG key ID: 8F2F97D3BE8D7735
2 changed files with 20 additions and 5 deletions

View file

@ -19,6 +19,7 @@ if(CPU_ARCHITECTURE STREQUAL "x86_64")
-DZT_USE_X64_ASM_SALSA2012=1
-DZT_USE_FAST_X64_ED25519=1
)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack")
elseif(CPU_ARCHITECTURE STREQUAL "aarch64")
add_definitions(-DZT_ARCHITECTURE=4 -DZT_ARCH_ARM_HAS_NEON=1 -DZT_SSO_SUPPORTED=1 -DZT_AES_NEON=1)
add_compile_options(-march=armv8-a+crypto -mtune=generic -mstrict-align)
@ -80,7 +81,7 @@ add_library(rustybits STATIC IMPORTED GLOBAL)
set_property(TARGET rustybits PROPERTY IMPORTED_LOCATION ${RUSTYBITS_LIB})
add_dependencies(rustybits rustybits_build)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack")
# Get & build dependencies not in conda
include (cmake/cpp-httplib.cmake)
@ -124,6 +125,14 @@ if(ZT1_CENTRAL_CONTROLLER)
)
endif()
if (APPLE)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(SECURITY_LIBRARY Security)
find_library(SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration)
find_library(CARBON Carbon)
find_library(CORESERVICES_LIBRARY CoreServices)
list(APPEND LINKED_LIBRARIES ${COREFOUNDATION_LIBRARY} ${SECURITY_LIBRARY} ${CARBON_LIBRARY} ${SYSTEM_CONFIGURATION_LIBRARY} ${CORESERVICES_LIBRARY})
endif()
add_executable(zerotier-one
one.cpp

View file

@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.13)
project(zerotier-osdep LANGUAGES CXX ASM)
if(APPLE)
enable_language(OBJCXX)
endif()
set(SRC_FILES
Arp.cpp
Arp.hpp
@ -39,12 +43,14 @@ if(LINUX)
LinuxNetLink.hpp)
endif()
if(MACOS)
if(APPLE)
list(APPEND SRC_FILES
MacOSEthernetTap.cpp
MacOSEthernetTap.hpp
MacEthernetTap.cpp
MacEthernetTap.hpp
MacKextEthernetTap.cpp
MacKextEthernetTap.hpp)
MacKextEthernetTap.hpp
MacDNSHelper.mm
MacDNSHelper.hpp)
endif()
add_library(zerotier-osdep STATIC ${SRC_FILES})