]> git.seodisparate.com - UDPConnection/commitdiff
Truncate "UDPConnection" to "UDPC"
authorStephen Seo <seo.disparate@gmail.com>
Thu, 9 Jan 2020 07:57:01 +0000 (16:57 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 9 Jan 2020 07:57:01 +0000 (16:57 +0900)
CMakeLists.txt
src/UDPC.h [moved from src/UDPConnection.h with 100% similarity]
src/UDPC_Defines.hpp
src/UDPConnection.cpp
src/test/TestUDPC.cpp
src/test/UDPC_NetworkTest.c

index 015e2655c28a3b10f5888ea4f717f64c0ee649b8..a2597afd7c6340cf8016beed34a6417d69466231 100644 (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)
similarity index 100%
rename from src/UDPConnection.h
rename to src/UDPC.h
index 2114cbc91191137e173b4303c29892c16857efc5..368434ea21c5bc2b1fac19d644780cf956bf6b08 100644 (file)
@@ -33,7 +33,7 @@
 #include <iostream>
 
 #include "TSLQueue.hpp"
-#include "UDPConnection.h"
+#include "UDPC.h"
 
 #include <sodium.h>
 
index fd021b314cc1dd96939c57868a83f72d0b656742..f0bb9811262b182d5cbef094a63ee22a3c25d030 100644 (file)
@@ -1,5 +1,5 @@
 #include "UDPC_Defines.hpp"
-#include "UDPConnection.h"
+#include "UDPC.h"
 
 #include <cassert>
 #include <chrono>
index f42c10b223230ad6cef95801dcc16698b70a291d..5e4c98c9cf195555f1bd00d0cddfd0357313616d 100644 (file)
@@ -1,6 +1,6 @@
 #include <gtest/gtest.h>
 
-#include <UDPConnection.h>
+#include <UDPC.h>
 #include <UDPC_Defines.hpp>
 
 #include <cstring>
index 3f072cc0cfcf6d6ead2f7db5443fd4a3ef0b7a2a..56a65f5e2421d90f6773296be521f88ba39313ba 100644 (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