From 0368e17e35a352bc5f804f83394265f0ab65870e Mon Sep 17 00:00:00 2001 From: Dmitriy Gerasimov <naeper@demlabs.net> Date: Mon, 15 Feb 2021 11:37:15 +0700 Subject: [PATCH] [*] Removed warning about unused compiler param [+] Notify server --- CMakeLists.txt | 3 +- cellframe-sdk | 2 +- cmake/OS_Detection.cmake | 125 --------------------------------------- sources/main.c | 2 +- 4 files changed, 3 insertions(+), 129 deletions(-) delete mode 100644 cmake/OS_Detection.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 350f075..f7d0f92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_C_STANDARD 11) SET( CPACK_PACKAGE_NAME "${PROJECT_NAME}") SET( CPACK_PACKAGE_VERSION_MAJOR 4) SET( CPACK_PACKAGE_VERSION_MINOR 3) -SET( CPACK_PACKAGE_VERSION_PATCH 26) +SET( CPACK_PACKAGE_VERSION_PATCH 27) # # init CellFrame SDK @@ -22,7 +22,6 @@ if(BUILD_WITH_GDB_DRIVER_MDBX) add_subdirectory(3rdparty/libmdbx) endif() - if (WIN32) set(CELLFRAME_MODULES "core chains mining network srv cs-blocks cs-dag-poa cs-block-poa cs-dag-pos cs-none srv-app srv-app-db srv-datum srv-stake srv-xchange modules-dynamic") elseif(BSD) diff --git a/cellframe-sdk b/cellframe-sdk index 187001d..966225c 160000 --- a/cellframe-sdk +++ b/cellframe-sdk @@ -1 +1 @@ -Subproject commit 187001dde486717358dea906567eba574c96b066 +Subproject commit 966225c95c2cbc3d31a767f2b4d2103069ee1c3e diff --git a/cmake/OS_Detection.cmake b/cmake/OS_Detection.cmake deleted file mode 100644 index 145b4e6..0000000 --- a/cmake/OS_Detection.cmake +++ /dev/null @@ -1,125 +0,0 @@ -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - set(OS_TYPE_DESKTOP ON) - set(LINUX ON) - set(UNIX ON) - EXECUTE_PROCESS( COMMAND cat /etc/os-release COMMAND grep VERSION_CODENAME COMMAND sed s/VERSION_CODENAME=// COMMAND tr -d '\n' OUTPUT_VARIABLE L_DEBIAN_OS_NAME) - EXECUTE_PROCESS( COMMAND cat /etc/os-release COMMAND grep VERSION_ID COMMAND sed s/VERSION_ID=// COMMAND tr -d '\n' COMMAND sed s/\\x22// COMMAND sed s/\\x22// OUTPUT_VARIABLE L_DEBIAN_OS_VERSION) - SET(DEBIAN_OS_NAME "${L_DEBIAN_OS_NAME}") - SET(DEBIAN_OS_VERSION ${L_DEBIAN_OS_VERSION}) - message("[ ] Debian OS ${DEBIAN_OS_VERSION} (${DEBIAN_OS_NAME})") -# check if we're building natively on Android (TERMUX) - EXECUTE_PROCESS( COMMAND uname -o COMMAND tr -d '\n' OUTPUT_VARIABLE OPERATING_SYSTEM) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android") - set(ANDROID ON) - set(UNIX ON) - set(LINUX OFF) - set(OS_TYPE_MOBILE ON) - message("[*] ANDROID build") - add_definitions(-DANDROID -DDAP_OS_ANDROID) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Win") - set(OS_TYPE_DESKTOP ON) -endif() - -if((CMAKE_BUILD_TYPE STREQUAL "Debug") OR (DAP_DEBUG)) - message("[!] Debug build") - SET(DAP_DEBUG ON) -else() - message("[!] Release build") - SET(DAP_RELEASE ON) -endif() - -if(CMAKE_SIZEOF_VOID_P EQUAL "8") - set(DEFAULT_BUILD_64 ON) -else() - set(DEFAULT_BUILD_64 OFF) -endif() -option(BUILD_64 "Build for 64-bit? 'OFF' builds for 32-bit." ${DEFAULT_BUILD_64}) - -if(BUILD_64) - set(ARCH_WIDTH "64") -else() - set(ARCH_WIDTH "32") -endif() -message(STATUS "[*] Building for a ${ARCH_WIDTH}-bit system") - -if(UNIX) - add_definitions ("-DDAP_OS_UNIX") - if (APPLE) - add_definitions ("-DDAP_OS_DARWIN -DDARWIN -DDAP_OS_BSD") - set(DARWIN ON) - endif() - - if (${CMAKE_SYSTEM_NAME} MATCHES "BSD" ) - add_definitions ("-DDAP_OS_BSD") - set(BSD ON) - endif() - - if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" ) - add_definitions ("-DDAP_OS_LINUX") - endif() - - if (LINUX) - if(DAP_DEBUG) - set(_CCOPT "-DDAP_DEBUG -Wall -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -pg -g3 -ggdb -fno-eliminate-unused-debug-symbols -fno-strict-aliasing") - set(_LOPT "-pg") - SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") - else() - set(_CCOPT "-Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -O3 -fPIC -fno-strict-aliasing -fno-ident -ffast-math -ftree-vectorize -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all -std=gnu11") - endif() - endif() - if (BSD) - if(DAP_DEBUG) - set(_CCOPT "-I/usr/local/include -DDAP_DEBUG -Wall -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -pg -g3 -ggdb -fno-eliminate-unused-debug-symbols -fno-strict-aliasing") - set(_LOPT "-pg -L/usr/local/lib ") - SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") - else() - set(_CCOPT "-I/usr/local/include -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -O3 -fPIC -fno-strict-aliasing -fno-ident -ffast-math -ftree-vectorize -fno-asynchronous-unwind-tables -ffunction-sections -std=gnu11") - set(_LOPT "-L/usr/local/lib ") - endif() - endif() - - if (ANDROID) - set(_CCOPT "${_CCOPT} -fforce-enable-int128 -std=gnu11") - add_definitions ("-DDAP_OS_ANDROID") - add_definitions ("-DDAP_OS_LINUX") - endif() - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}") - set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${_LOPT}") - -endif() - -if(WIN32) - message(STATUS "[*] Building for Windows") - add_definitions("-DHAVE_PREAD") - add_definitions("-DHAVE_MMAP") - add_definitions("-DHAVE_STRNDUP") - - add_definitions ("-DUNDEBUG") - add_definitions ("-DNDEBUG") - add_definitions ("-DWIN32") - add_definitions ("-D_WINDOWS") - add_definitions ("-D__WINDOWS__") - add_definitions ("-D_CRT_SECURE_NO_WARNINGS") - add_definitions ("-DCURL_STATICLIB") - add_definitions("-DHAVE_PREAD") - add_definitions("-DHAVE_MMAP") - add_definitions("-DHAVE_STRNDUP") - add_definitions("-DNGHTTP2_STATICLIB") - add_compile_definitions(WINVER=0x0600 _WIN32_WINNT=0x0600) - add_definitions ("-DDAP_OS_WINDOWS") - - if(DAP_DEBUG) - set(_CCOPT "-mconsole -static -Wall -std=gnu11 -Wextra -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -g3 -ggdb -fno-strict-aliasing -fno-eliminate-unused-debug-symbols -pg") - set(_LOPT "-mconsole -static -pg") - else() - set(_CCOPT "-static -std=gnu11 -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -O3 -fno-ident -ffast-math -fno-strict-aliasing -ftree-vectorize -mfpmath=sse -mmmx -msse2 -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all") - endif() - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT} ") - set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${_LOPT}") - - include_directories(3rdparty/uthash/src/) - include_directories(3rdparty/wepoll/) - #include_directories(libdap-chain-net-srv-vpn/) -endif() diff --git a/sources/main.c b/sources/main.c index 41f4398..3a64060 100755 --- a/sources/main.c +++ b/sources/main.c @@ -411,7 +411,7 @@ int main( int argc, const char **argv ) if( l_port > 0 ) { l_server = dap_server_new(l_events, (dap_config_get_item_str(g_config, "server", "listen_address")), - (uint16_t) l_port, DAP_SERVER_TCP, NULL ); + (uint16_t) l_port, SERVER_TCP, NULL ); } else log_it( L_WARNING, "Server is enabled but no port is defined" ); -- GitLab