diff --git a/.gitignore b/.gitignore
index bbd212f2b..d9620f10d 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,9 @@
-build/
+/build
+/cmake-build-debug
+/cmake-build-release
/version.h
+/.idea
+/go/.idea
.DS_Store
.Trashes
*.swp
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 0e40fe8f5..000000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-
-# Default ignored files
-/workspace.xml
\ No newline at end of file
diff --git a/.idea/ZeroTierOne.iml b/.idea/ZeroTierOne.iml
deleted file mode 100644
index 5e764c4f0..000000000
--- a/.idea/ZeroTierOne.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index a55e7a179..000000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/dictionaries/api.xml b/.idea/dictionaries/api.xml
deleted file mode 100644
index 53167764f..000000000
--- a/.idea/dictionaries/api.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- apisocket
- nwid
- secrand
- sockaddr
- unmarshals
-
-
-
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 146ab09b7..000000000
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 28a804d89..000000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 6b5db6854..000000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7f4..000000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml
deleted file mode 100644
index 97ad6d2d9..000000000
--- a/.idea/watcherTasks.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7487351ec..2f1e839a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required (VERSION 3.8)
+project(zerotier DESCRIPTION "ZeroTier Network Hypervisor" LANGUAGES CXX C)
if(${CMAKE_VERSION} VERSION_LESS 3.15)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
@@ -7,33 +8,32 @@ else()
endif()
if(WIN32)
- # If building on Windows, set minimum target to Windows 7
set(CMAKE_SYSTEM_VERSION "7" CACHE STRING INTERNAL FORCE)
endif(WIN32)
+set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X Deployment Version")
set(ZEROTIER_ONE_VERSION_MAJOR 2 CACHE INTERNAL "")
set(ZEROTIER_ONE_VERSION_MINOR 0 CACHE INTERNAL "")
set(ZEROTIER_ONE_VERSION_REVISION 0 CACHE INTERNAL "")
set(ZEROTIER_ONE_VERSION_BUILD 0 CACHE INTERNAL "")
+configure_file(
+ ${CMAKE_SOURCE_DIR}/version.h.in
+ ${CMAKE_BINARY_DIR}/version.h
+)
+
set(default_build_type "Release")
-if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
- set(default_build_type "Debug")
-endif()
+#if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
+# set(default_build_type "Debug")
+#endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
- set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
- STRING "Choose the type of build." FORCE)
- # Set the possible values of build type for cmake-gui
- set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
- "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+ set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
option(BUILD_CENTRAL_CONTROLLER "Build ZeroTier Central Controller" OFF)
-option(ZT_TRACE "Trace Messages" OFF)
-option(ZT_DEBUG_TRACE "Debug Trace Messages" OFF)
-
if (BUILD_CENTRAL_CONTROLLER)
find_package(PostgreSQL REQUIRED)
set(ENABLE_SSL_SUPPORT OFF)
@@ -45,25 +45,21 @@ if (BUILD_CENTRAL_CONTROLLER)
add_subdirectory("ext/librabbitmq")
endif(BUILD_CENTRAL_CONTROLLER)
-set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X Deployment Version")
-
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DZT_TRACE)
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
-project(zerotier
- DESCRIPTION "ZeroTier Network Hypervisor"
- LANGUAGES CXX C)
-
if(WIN32)
+ message("++ Setting Windows Compiler Flags ${CMAKE_BUILD_TYPE}")
add_definitions(-DNOMINMAX)
else(WIN32)
if(APPLE)
- message("Setting macOS Compiler Flags ${CMAKE_BUILD_TYPE}")
+ message("++ Setting MacOS Compiler Flags ${CMAKE_BUILD_TYPE}")
add_compile_options(
-Wall
-Wno-deprecated
+ -Wno-unused-function
-mmacosx-version-min=10.9
$<$:-g>
$<$:-O0>
@@ -79,17 +75,13 @@ else(WIN32)
$<$:-flto>
)
- elseif (
- CMAKE_SYSTEM_NAME MATCHES "Linux" OR
- CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR
- CMAKE_SYSTEM_NAME MATCHES "OpenBSD" OR
- CMAKE_SYSTEM_NAME MATCHES "NetBSD"
- )
+ else(APPLE)
- message("Setting Linux/BSD Compiler Flags (${CMAKE_BUILD_TYPE})")
+ message("++ Setting Linux/BSD/Posix Compiler Flags (${CMAKE_BUILD_TYPE})")
add_compile_options(
-Wall
-Wno-deprecated
+ -Wno-unused-function
$<$:-g>
$<$:-O0>
$<$:-O3>
@@ -110,10 +102,9 @@ if (
CMAKE_SYSTEM_PROCESSOR MATCHES "i586" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "i686"
)
- message("Adding SSE and AES-NI flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
+ message("++ Adding SSE and AES-NI flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
add_compile_options(
-maes
- -mmmx
-mrdrnd
-mpclmul
-msse
@@ -126,9 +117,6 @@ endif()
if(ZT_TRACE)
add_definitions(-DZT_TRACE)
endif()
-if(ZT_DEBUG_TRACE)
- add_definitions(-DZT_DEBUG_TRACE)
-endif()
add_subdirectory(node)
add_subdirectory(controller)
@@ -136,12 +124,6 @@ add_subdirectory(osdep)
add_subdirectory(root)
add_subdirectory(go/native)
-#if(WIN32)
-# add_subdirectory("windows/WinUI")
-# add_subdirectory("windows/copyutil")
-# add_definitions(-DNOMINMAX)
-#endif(WIN32)
-
set(
zt_osdep
zt_core
@@ -149,25 +131,18 @@ set(
zt_go_native
)
-configure_file(
- ${CMAKE_SOURCE_DIR}/version.h.in
- ${CMAKE_BINARY_DIR}/version.h
-)
-
-#set(src
-# one.cpp
-# "ext/http-parser/http_parser.c"
-#)
-#set(headers
-# "ext/http-parser/http_parser.h"
-#)
-
if(WIN32)
set(libs ${libs} wsock32 ws2_32 rpcrt4 iphlpapi)
else(WIN32)
set(libs ${libs} pthread)
endif(WIN32)
+#if(WIN32)
+# add_subdirectory("windows/WinUI")
+# add_subdirectory("windows/copyutil")
+# add_definitions(-DNOMINMAX)
+#endif(WIN32)
+
#if(WIN32)
# set(libs ${libs} wsock32 ws2_32 rpcrt4 iphlpapi)
# set(src
@@ -203,6 +178,6 @@ add_custom_command(
)
add_custom_target(build_zerotier ALL DEPENDS zerotier)
-add_executable(zerotier-selftest selftest.cpp)
-target_link_libraries(zerotier-selftest ${libs} zt_core zt_osdep)
-target_compile_features(zerotier-selftest PUBLIC cxx_std_11)
+#add_executable(zerotier-selftest selftest.cpp)
+#target_link_libraries(zerotier-selftest ${libs} zt_core zt_osdep)
+#target_compile_features(zerotier-selftest PUBLIC cxx_std_11)
diff --git a/attic/Binder.hpp b/attic/Binder.hpp
deleted file mode 100644
index 67debc80b..000000000
--- a/attic/Binder.hpp
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Copyright (c)2019 ZeroTier, Inc.
- *
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2023-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
- */
-/****/
-
-#ifndef ZT_BINDER_HPP
-#define ZT_BINDER_HPP
-
-#include "../node/Constants.hpp"
-
-#include
-#include
-#include
-#include
-
-#ifdef __WINDOWS__
-#include
-#include
-#include
-#include
-#include
-#else
-#include
-#include
-#include
-#include
-#include
-#ifdef __LINUX__
-#include
-#include
-#endif
-#endif
-
-#include
-#include
-#include
-#include
-#include