From 16cb18942bacff5c35e399448ad56ca1fa18cf92 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Thu, 27 Feb 2025 15:51:45 -0600 Subject: [PATCH 1/2] Add luasocket library for managing an internal server --- .gitmodules | 3 +++ CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ libs/luasocket | 1 + 3 files changed, 37 insertions(+) create mode 160000 libs/luasocket diff --git a/.gitmodules b/.gitmodules index 0c90bb4..b068b0c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "libs/luautf8"] path = libs/luautf8 url = https://github.com/starwing/luautf8.git +[submodule "libs/luasocket"] + path = libs/luasocket + url = https://github.com/lunarmodules/luasocket.git diff --git a/CMakeLists.txt b/CMakeLists.txt index f89a281..efa5205 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,6 +292,39 @@ target_link_libraries(lua-utf8 install(TARGETS lua-utf8 RUNTIME DESTINATION ".") install(FILES $ DESTINATION ".") +# luasocket module + +add_library(luasocket SHARED + "libs/luasocket/src/auxiliar.c" + "libs/luasocket/src/buffer.c" + "libs/luasocket/src/compat.c" + "libs/luasocket/src/except.c" + "libs/luasocket/src/inet.c" + "libs/luasocket/src/io.c" + "libs/luasocket/src/luasocket.c" + "libs/luasocket/src/options.c" + "libs/luasocket/src/select.c" + "libs/luasocket/src/tcp.c" + "libs/luasocket/src/timeout.c" + "libs/luasocket/src/udp.c" + "libs/luasocket/src/wsocket.c" +) + +target_include_directories(luasocket + PRIVATE + ${LSOCKET_SOURCE_DIR}/src +) + +target_link_libraries(luasocket + PRIVATE + LuaJIT::LuaJIT + wsock32 + ws2_32 +) + +install(TARGETS luasocket RUNTIME DESTINATION ".") +install(FILES $ DESTINATION ".") + # lzip module add_library(lzip SHARED libs/LZip/lzip.cpp) diff --git a/libs/luasocket b/libs/luasocket new file mode 160000 index 0000000..66cdeca --- /dev/null +++ b/libs/luasocket @@ -0,0 +1 @@ +Subproject commit 66cdeca6636a017fe8ed2b0ee431798f8fb4ade3 From 472eac78906b90135f110f5bc23f85b982334f9b Mon Sep 17 00:00:00 2001 From: Wires77 Date: Fri, 28 Mar 2025 22:05:10 -0500 Subject: [PATCH 2/2] Change name of DLL --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index efa5205..29898ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,6 +322,7 @@ target_link_libraries(luasocket ws2_32 ) +set_target_properties( luasocket PROPERTIES OUTPUT_NAME "socket" ) install(TARGETS luasocket RUNTIME DESTINATION ".") install(FILES $ DESTINATION ".")