mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-09-08 07:42:55 +02:00
fix compile & link on macOS
This commit is contained in:
parent
36219c59ae
commit
a78ac17d10
2 changed files with 20 additions and 5 deletions
|
@ -19,6 +19,7 @@ if(CPU_ARCHITECTURE STREQUAL "x86_64")
|
||||||
-DZT_USE_X64_ASM_SALSA2012=1
|
-DZT_USE_X64_ASM_SALSA2012=1
|
||||||
-DZT_USE_FAST_X64_ED25519=1
|
-DZT_USE_FAST_X64_ED25519=1
|
||||||
)
|
)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack")
|
||||||
elseif(CPU_ARCHITECTURE STREQUAL "aarch64")
|
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_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)
|
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})
|
set_property(TARGET rustybits PROPERTY IMPORTED_LOCATION ${RUSTYBITS_LIB})
|
||||||
add_dependencies(rustybits rustybits_build)
|
add_dependencies(rustybits rustybits_build)
|
||||||
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack")
|
|
||||||
|
|
||||||
# Get & build dependencies not in conda
|
# Get & build dependencies not in conda
|
||||||
include (cmake/cpp-httplib.cmake)
|
include (cmake/cpp-httplib.cmake)
|
||||||
|
@ -124,6 +125,14 @@ if(ZT1_CENTRAL_CONTROLLER)
|
||||||
)
|
)
|
||||||
endif()
|
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
|
add_executable(zerotier-one
|
||||||
one.cpp
|
one.cpp
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
project(zerotier-osdep LANGUAGES CXX ASM)
|
project(zerotier-osdep LANGUAGES CXX ASM)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
enable_language(OBJCXX)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(SRC_FILES
|
set(SRC_FILES
|
||||||
Arp.cpp
|
Arp.cpp
|
||||||
Arp.hpp
|
Arp.hpp
|
||||||
|
@ -39,12 +43,14 @@ if(LINUX)
|
||||||
LinuxNetLink.hpp)
|
LinuxNetLink.hpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MACOS)
|
if(APPLE)
|
||||||
list(APPEND SRC_FILES
|
list(APPEND SRC_FILES
|
||||||
MacOSEthernetTap.cpp
|
MacEthernetTap.cpp
|
||||||
MacOSEthernetTap.hpp
|
MacEthernetTap.hpp
|
||||||
MacKextEthernetTap.cpp
|
MacKextEthernetTap.cpp
|
||||||
MacKextEthernetTap.hpp)
|
MacKextEthernetTap.hpp
|
||||||
|
MacDNSHelper.mm
|
||||||
|
MacDNSHelper.hpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(zerotier-osdep STATIC ${SRC_FILES})
|
add_library(zerotier-osdep STATIC ${SRC_FILES})
|
||||||
|
|
Loading…
Add table
Reference in a new issue