Truncate "UDPConnection" to "UDPC"

This commit is contained in:
Stephen Seo 2020-01-09 16:57:01 +09:00
parent 40c4c9b2ba
commit f588d409c9
6 changed files with 24 additions and 24 deletions

View file

@ -1,9 +1,9 @@
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
)
@ -17,20 +17,20 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
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_link_libraries(UDPConnection PUBLIC pthread)
target_compile_features(UDPC PUBLIC cxx_std_11)
target_link_libraries(UDPC PUBLIC pthread)
if(WIN32)
if(MINGW)
target_compile_definitions(UDPConnection PUBLIC UDPC_PLATFORM_MINGW)
target_link_libraries(UDPConnection PUBLIC ws2_32)
target_link_libraries(UDPConnection PUBLIC iphlpapi)
target_compile_definitions(UDPC PUBLIC UDPC_PLATFORM_MINGW)
target_link_libraries(UDPC PUBLIC ws2_32)
target_link_libraries(UDPC PUBLIC iphlpapi)
else()
target_link_libraries(UDPConnection PUBLIC Ws2_32)
target_link_libraries(UDPConnection PUBLIC Iphlpapi)
target_link_libraries(UDPC PUBLIC Ws2_32)
target_link_libraries(UDPC PUBLIC Iphlpapi)
endif()
endif()
@ -40,10 +40,10 @@ else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBSODIUM QUIET libsodium)
if(LIBSODIUM_FOUND)
target_compile_definitions(UDPConnection PUBLIC UDPC_LIBSODIUM_ENABLED)
target_link_libraries(UDPConnection PUBLIC ${LIBSODIUM_LIBRARIES})
target_include_directories(UDPConnection PUBLIC ${LIBSODIUM_INCLUDE_DIRS})
target_compile_options(UDPConnection PUBLIC ${LIBSODIUM_CFLAGS_OTHER})
target_compile_definitions(UDPC PUBLIC UDPC_LIBSODIUM_ENABLED)
target_link_libraries(UDPC PUBLIC ${LIBSODIUM_LIBRARIES})
target_include_directories(UDPC PUBLIC ${LIBSODIUM_INCLUDE_DIRS})
target_compile_options(UDPC PUBLIC ${LIBSODIUM_CFLAGS_OTHER})
message(STATUS "libsodium enabled")
else()
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})
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)
endif()
set(UDPC_NetworkTest_SOURCES
src/test/UDPC_NetworkTest.c)
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)
endif()
install(TARGETS UDPConnection DESTINATION lib)
install(TARGETS UDPC DESTINATION lib)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/UDPConnection.h
${CMAKE_CURRENT_SOURCE_DIR}/src/UDPC.h
DESTINATION include)

View file

@ -33,7 +33,7 @@
#include <iostream>
#include "TSLQueue.hpp"
#include "UDPConnection.h"
#include "UDPC.h"
#include <sodium.h>

View file

@ -1,5 +1,5 @@
#include "UDPC_Defines.hpp"
#include "UDPConnection.h"
#include "UDPC.h"
#include <cassert>
#include <chrono>

View file

@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <UDPConnection.h>
#include <UDPC.h>
#include <UDPC_Defines.hpp>
#include <cstring>

View file

@ -8,7 +8,7 @@
#include <sodium.h>
#endif
#include <UDPConnection.h>
#include <UDPC.h>
#define QUEUED_MAX_SIZE 32
#define SEND_IDS_SIZE 64