mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 13:03:45 +02:00
Moar reorganization.
This commit is contained in:
parent
6da8f2bb05
commit
3dd2c94f4e
165 changed files with 2850 additions and 530 deletions
|
@ -1,6 +1,11 @@
|
||||||
cmake_minimum_required (VERSION 3.8)
|
cmake_minimum_required (VERSION 3.8)
|
||||||
project(zerotier DESCRIPTION "ZeroTier Network Hypervisor" LANGUAGES CXX C)
|
project(zerotier DESCRIPTION "ZeroTier Network Hypervisor" LANGUAGES CXX C)
|
||||||
|
|
||||||
|
set(ZEROTIER_VERSION_MAJOR 1 CACHE INTERNAL "")
|
||||||
|
set(ZEROTIER_VERSION_MINOR 9 CACHE INTERNAL "")
|
||||||
|
set(ZEROTIER_VERSION_REVISION 0 CACHE INTERNAL "")
|
||||||
|
set(ZEROTIER_VERSION_BUILD 0 CACHE INTERNAL "")
|
||||||
|
|
||||||
if(${CMAKE_VERSION} VERSION_LESS 3.15)
|
if(${CMAKE_VERSION} VERSION_LESS 3.15)
|
||||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||||
else()
|
else()
|
||||||
|
@ -13,17 +18,8 @@ set(default_build_type "Release")
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CMAKE_SYSTEM_VERSION "7" CACHE STRING INTERNAL FORCE)
|
set(CMAKE_SYSTEM_VERSION "7" CACHE STRING INTERNAL FORCE)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X Deployment Version")
|
|
||||||
|
|
||||||
set(ZEROTIER_VERSION_MAJOR 1 CACHE INTERNAL "")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X Deployment Version")
|
||||||
set(ZEROTIER_VERSION_MINOR 9 CACHE INTERNAL "")
|
|
||||||
set(ZEROTIER_VERSION_REVISION 0 CACHE INTERNAL "")
|
|
||||||
set(ZEROTIER_VERSION_BUILD 0 CACHE INTERNAL "")
|
|
||||||
|
|
||||||
configure_file(
|
|
||||||
${CMAKE_SOURCE_DIR}/version.h.in
|
|
||||||
${CMAKE_BINARY_DIR}/version.h
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||||
|
@ -31,17 +27,17 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(BUILD_CENTRAL_CONTROLLER "Build ZeroTier Central Controller" OFF)
|
#option(BUILD_CENTRAL_CONTROLLER "Build ZeroTier Central Controller" OFF)
|
||||||
if (BUILD_CENTRAL_CONTROLLER)
|
#if (BUILD_CENTRAL_CONTROLLER)
|
||||||
find_package(PostgreSQL REQUIRED)
|
# find_package(PostgreSQL REQUIRED)
|
||||||
set(ENABLE_SSL_SUPPORT OFF)
|
# set(ENABLE_SSL_SUPPORT OFF)
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
# set(BUILD_SHARED_LIBS OFF)
|
||||||
set(BUILD_EXAMPLES OFF)
|
# set(BUILD_EXAMPLES OFF)
|
||||||
set(BUILD_TOOLS OFF)
|
# set(BUILD_TOOLS OFF)
|
||||||
set(BUILD_TESTS OFF)
|
# set(BUILD_TESTS OFF)
|
||||||
set(BUILD_API_DOCS OFF)
|
# set(BUILD_API_DOCS OFF)
|
||||||
add_subdirectory("ext/librabbitmq")
|
# add_subdirectory("ext/librabbitmq")
|
||||||
endif(BUILD_CENTRAL_CONTROLLER)
|
#endif(BUILD_CENTRAL_CONTROLLER)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
add_definitions(-DZT_DEBUG)
|
add_definitions(-DZT_DEBUG)
|
||||||
|
@ -69,7 +65,7 @@ else(WIN32)
|
||||||
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
||||||
)
|
)
|
||||||
add_link_options(
|
add_link_options(
|
||||||
-mmacosx-version-min=10.9
|
-mmacosx-version-min=10.12
|
||||||
$<$<CONFIG:RELEASE>:-flto>
|
$<$<CONFIG:RELEASE>:-flto>
|
||||||
)
|
)
|
||||||
else(APPLE)
|
else(APPLE)
|
||||||
|
@ -95,28 +91,29 @@ if (
|
||||||
CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR
|
CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR
|
||||||
CMAKE_SYSTEM_PROCESSOR MATCHES "amd64"
|
CMAKE_SYSTEM_PROCESSOR MATCHES "amd64"
|
||||||
)
|
)
|
||||||
message("++ Adding SSE and AES-NI flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
|
message("++ Adding flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
add_compile_options(-maes -mrdrnd -mpclmul -msse -msse2 -mssse3)
|
add_compile_options(-maes -mrdrnd -mpclmul -msse -msse2 -mssse3)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(node)
|
add_subdirectory(core)
|
||||||
add_subdirectory(controller)
|
add_subdirectory(controller)
|
||||||
add_subdirectory(osdep)
|
add_subdirectory(osdep)
|
||||||
add_subdirectory(go/native)
|
add_subdirectory(serviceiocore)
|
||||||
|
|
||||||
#if(BUILD_CENTRAL_CONTROLLER)
|
#if(BUILD_CENTRAL_CONTROLLER)
|
||||||
# set(libs ${libs} rabbitmq-static ${PostgreSQL_LIBRARIES})
|
# set(libs ${libs} rabbitmq-static ${PostgreSQL_LIBRARIES})
|
||||||
#endif(BUILD_CENTRAL_CONTROLLER)
|
#endif(BUILD_CENTRAL_CONTROLLER)
|
||||||
|
|
||||||
set(
|
set(
|
||||||
zt_osdep
|
zt_core
|
||||||
zt_core
|
zt_osdep
|
||||||
zt_controller
|
zt_controller
|
||||||
zt_go_native
|
zt_service_io_core
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(zerotier ALL
|
add_custom_target(zerotier ALL
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/go
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
COMMAND rm -f ../build/zerotier && go build -trimpath -ldflags -s -o ../build/zerotier cmd/zerotier/zerotier.go
|
COMMAND rm -f ./build/zerotier && go build -trimpath -ldflags -s -o ./build/zerotier cmd/zerotier/zerotier.go
|
||||||
)
|
)
|
||||||
add_dependencies(zerotier zt_osdep zt_core zt_controller zt_go_native)
|
add_dependencies(zerotier zt_osdep zt_core zt_controller zt_service_io_core)
|
||||||
|
ADDITIONAL_CLEAN_FILES(./build/zerotier)
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
cmake_minimum_required (VERSION 2.8)
|
cmake_minimum_required (VERSION 2.8)
|
||||||
project(zt_core)
|
project(zt_core)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
version.h.in
|
||||||
|
version.h
|
||||||
|
)
|
||||||
|
|
||||||
set(core_headers
|
set(core_headers
|
||||||
../include/ZeroTierCore.h
|
zerotier.h
|
||||||
Address.hpp
|
Address.hpp
|
||||||
Buf.hpp
|
Buf.hpp
|
||||||
C25519.hpp
|
C25519.hpp
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#ifndef ZT_CONSTANTS_HPP
|
#ifndef ZT_CONSTANTS_HPP
|
||||||
#define ZT_CONSTANTS_HPP
|
#define ZT_CONSTANTS_HPP
|
||||||
|
|
||||||
#include "ZeroTierCore.h"
|
#include "zerotier.h"
|
||||||
#include "OS.hpp"
|
#include "OS.hpp"
|
||||||
|
|
||||||
#if __has_include("version.h")
|
#if __has_include("version.h")
|
||||||
|
|
2328
core/zerotier.h
Normal file
2328
core/zerotier.h
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,10 +0,0 @@
|
||||||
Miscellaneous Stuff
|
|
||||||
======
|
|
||||||
|
|
||||||
This subfolder contains:
|
|
||||||
|
|
||||||
* Bundled third party libraries that are compiled into the binary on platforms and Linux distributions where they are not available on the system.
|
|
||||||
|
|
||||||
* Pre-compiled binaries for some platforms, such as pre-built and signed drivers for Mac and Windows.
|
|
||||||
|
|
||||||
* Miscellaneous files used by installers and packages on various platform targets.
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue