From 2a3bb1bef8af536763c102bbfce55d17503d058c Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 29 Jul 2021 12:18:01 +0200 Subject: [PATCH] add luasocket --- .gitmodules | 3 +++ CMakeLists.txt | 9 +++++---- lib/CMakeLists.txt | 5 ----- lib/luasocket-cmake | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 lib/CMakeLists.txt create mode 160000 lib/luasocket-cmake diff --git a/.gitmodules b/.gitmodules index 0d23bc7..d4058b3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "include/toml11"] path = include/toml11 url = https://github.com/ToruNiina/toml11 +[submodule "lib/luasocket-cmake"] + path = lib/luasocket-cmake + url = https://github.com/trevex/luasocket diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c437fb..13da1e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,8 +25,9 @@ include_directories("rapidjson/include") include_directories("websocketpp") add_subdirectory("socket.io-client-cpp") add_subdirectory("include/commandline") -# builds all libraries that don't have cmakelists -add_subdirectory("lib") +# luasocket +set(WANTS_BUILD_STATIC_LIBRARY ON) +add_subdirectory("lib/luasocket-cmake") set(CMAKE_CXX_STANDARD 17) @@ -59,11 +60,11 @@ target_include_directories(BeamMP-Server PUBLIC ${Boost_INCLUDE_DIRS} ${LUA_INCL find_package(OpenSSL REQUIRED) if (UNIX) - target_link_libraries(BeamMP-Server z pthread stdc++fs ${LUA_LIBRARIES} crypto ${OPENSSL_LIBRARIES} commandline sioclient_tls luasocket) + target_link_libraries(BeamMP-Server z pthread stdc++fs ${LUA_LIBRARIES} crypto ${OPENSSL_LIBRARIES} commandline sioclient_tls luasocket_library_static) elseif (WIN32) include(FindLua) find_package(ZLIB REQUIRED) find_package(RapidJSON CONFIG REQUIRED) target_include_directories(BeamMP-Server PRIVATE ${RAPIDJSON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) - target_link_libraries(BeamMP-Server PRIVATE ws2_32 ZLIB::ZLIB ${LUA_LIBRARIES} ${OPENSSL_LIBRARIES} commandline sioclient_tls luasocket) + target_link_libraries(BeamMP-Server PRIVATE ws2_32 ZLIB::ZLIB ${LUA_LIBRARIES} ${OPENSSL_LIBRARIES} commandline sioclient_tls luasocket_library_static) endif () diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt deleted file mode 100644 index ab2d18a..0000000 --- a/lib/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - - -############# luasocket ############# - -##################################### \ No newline at end of file diff --git a/lib/luasocket-cmake b/lib/luasocket-cmake new file mode 160000 index 0000000..2cb3208 --- /dev/null +++ b/lib/luasocket-cmake @@ -0,0 +1 @@ +Subproject commit 2cb3208cf32d8349c04af2884e50db008ff27ef8