Truncate "UDPConnection" to "UDPC"
This commit is contained in:
parent
40c4c9b2ba
commit
f588d409c9
6 changed files with 24 additions and 24 deletions
|
@ -1,9 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.7)
|
cmake_minimum_required(VERSION 3.7)
|
||||||
project(UDPConnection)
|
project(UDPC)
|
||||||
|
|
||||||
set(UDPConnection_VERSION 1.0)
|
set(UDPC_VERSION 1.0)
|
||||||
|
|
||||||
set(UDPConnection_SOURCES
|
set(UDPC_SOURCES
|
||||||
src/UDPConnection.cpp
|
src/UDPConnection.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,20 +17,20 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(UDPConnection ${UDPConnection_SOURCES})
|
add_library(UDPC ${UDPC_SOURCES})
|
||||||
|
|
||||||
set_target_properties(UDPConnection PROPERTIES VERSION ${UDPConnection_VERSION})
|
set_target_properties(UDPC PROPERTIES VERSION ${UDPC_VERSION})
|
||||||
|
|
||||||
target_compile_features(UDPConnection PUBLIC cxx_std_11)
|
target_compile_features(UDPC PUBLIC cxx_std_11)
|
||||||
target_link_libraries(UDPConnection PUBLIC pthread)
|
target_link_libraries(UDPC PUBLIC pthread)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
target_compile_definitions(UDPConnection PUBLIC UDPC_PLATFORM_MINGW)
|
target_compile_definitions(UDPC PUBLIC UDPC_PLATFORM_MINGW)
|
||||||
target_link_libraries(UDPConnection PUBLIC ws2_32)
|
target_link_libraries(UDPC PUBLIC ws2_32)
|
||||||
target_link_libraries(UDPConnection PUBLIC iphlpapi)
|
target_link_libraries(UDPC PUBLIC iphlpapi)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(UDPConnection PUBLIC Ws2_32)
|
target_link_libraries(UDPC PUBLIC Ws2_32)
|
||||||
target_link_libraries(UDPConnection PUBLIC Iphlpapi)
|
target_link_libraries(UDPC PUBLIC Iphlpapi)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -40,10 +40,10 @@ else()
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(LIBSODIUM QUIET libsodium)
|
pkg_check_modules(LIBSODIUM QUIET libsodium)
|
||||||
if(LIBSODIUM_FOUND)
|
if(LIBSODIUM_FOUND)
|
||||||
target_compile_definitions(UDPConnection PUBLIC UDPC_LIBSODIUM_ENABLED)
|
target_compile_definitions(UDPC PUBLIC UDPC_LIBSODIUM_ENABLED)
|
||||||
target_link_libraries(UDPConnection PUBLIC ${LIBSODIUM_LIBRARIES})
|
target_link_libraries(UDPC PUBLIC ${LIBSODIUM_LIBRARIES})
|
||||||
target_include_directories(UDPConnection PUBLIC ${LIBSODIUM_INCLUDE_DIRS})
|
target_include_directories(UDPC PUBLIC ${LIBSODIUM_INCLUDE_DIRS})
|
||||||
target_compile_options(UDPConnection PUBLIC ${LIBSODIUM_CFLAGS_OTHER})
|
target_compile_options(UDPC PUBLIC ${LIBSODIUM_CFLAGS_OTHER})
|
||||||
message(STATUS "libsodium enabled")
|
message(STATUS "libsodium enabled")
|
||||||
else()
|
else()
|
||||||
message(STATUS "libsodium not found, UDPC will be compiled without libsodium support")
|
message(STATUS "libsodium not found, UDPC will be compiled without libsodium support")
|
||||||
|
@ -61,18 +61,18 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
)
|
)
|
||||||
add_executable(UnitTest ${UDPC_UnitTest_SOURCES})
|
add_executable(UnitTest ${UDPC_UnitTest_SOURCES})
|
||||||
target_compile_features(UnitTest PUBLIC cxx_std_11)
|
target_compile_features(UnitTest PUBLIC cxx_std_11)
|
||||||
target_link_libraries(UnitTest PUBLIC UDPConnection ${GTEST_BOTH_LIBRARIES})
|
target_link_libraries(UnitTest PUBLIC UDPC ${GTEST_BOTH_LIBRARIES})
|
||||||
target_include_directories(UnitTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
target_include_directories(UnitTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(UDPC_NetworkTest_SOURCES
|
set(UDPC_NetworkTest_SOURCES
|
||||||
src/test/UDPC_NetworkTest.c)
|
src/test/UDPC_NetworkTest.c)
|
||||||
add_executable(NetworkTest ${UDPC_NetworkTest_SOURCES})
|
add_executable(NetworkTest ${UDPC_NetworkTest_SOURCES})
|
||||||
target_link_libraries(NetworkTest PUBLIC UDPConnection)
|
target_link_libraries(NetworkTest PUBLIC UDPC)
|
||||||
target_include_directories(NetworkTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
target_include_directories(NetworkTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS UDPConnection DESTINATION lib)
|
install(TARGETS UDPC DESTINATION lib)
|
||||||
install(FILES
|
install(FILES
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/UDPConnection.h
|
${CMAKE_CURRENT_SOURCE_DIR}/src/UDPC.h
|
||||||
DESTINATION include)
|
DESTINATION include)
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "TSLQueue.hpp"
|
#include "TSLQueue.hpp"
|
||||||
#include "UDPConnection.h"
|
#include "UDPC.h"
|
||||||
|
|
||||||
#include <sodium.h>
|
#include <sodium.h>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "UDPC_Defines.hpp"
|
#include "UDPC_Defines.hpp"
|
||||||
#include "UDPConnection.h"
|
#include "UDPC.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <UDPConnection.h>
|
#include <UDPC.h>
|
||||||
#include <UDPC_Defines.hpp>
|
#include <UDPC_Defines.hpp>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <sodium.h>
|
#include <sodium.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <UDPConnection.h>
|
#include <UDPC.h>
|
||||||
|
|
||||||
#define QUEUED_MAX_SIZE 32
|
#define QUEUED_MAX_SIZE 32
|
||||||
#define SEND_IDS_SIZE 64
|
#define SEND_IDS_SIZE 64
|
||||||
|
|
Loading…
Reference in a new issue