Skip to content

Commit

Permalink
add support for growtopia version 3.92
Browse files Browse the repository at this point in the history
  • Loading branch information
ZTzTopia committed Jun 20, 2022
1 parent 826fb8e commit eac9050
Show file tree
Hide file tree
Showing 51 changed files with 8,750 additions and 3,247 deletions.
59 changes: 25 additions & 34 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
cmake_minimum_required(VERSION 3.0..3.23)
project(Main LANGUAGES CXX)
project(MAIN LANGUAGES CXX)

file(GLOB INCLUDE_FILES
set(GTPROXY_VERSION "${CMAKE_PROJECT_VERSION}")
if (GTPROXY_BUILD_VERSION)
set(GTPROXY_VERSION "${GTPROXY_VERSION}+${GTPROXY_BUILD_VERSION}")
endif ()

file(GLOB GTPROXY_INCLUDE_FILES
*.h
client/*.h
command/*.h
enetwrapper/*.h
include/*.hpp
include/pcg/*.hpp
items/*.h
player/*.h
server/*.h
utils/*.h
world/*.h
../vendor/proton/shared/util/*.h)

file(GLOB SOURCE_FILES
**/*.h
**/*.hpp
**/**/*.hpp
../vendor/proton/**/*.h
../vendor/proton/**/**/*.h)

file(GLOB GTPROXY_SOURCE_FILES
*.cpp
client/*.cpp
command/*.cpp
enetwrapper/*.cpp
player/*.cpp
server/*.cpp
../vendor/proton/shared/util/*.cpp)
**/*.cpp
../vendor/proton/**/**/*.cpp)

add_executable(${PROJECT_NAME}
${INCLUDE_FILES}
${SOURCE_FILES})
${GTPROXY_INCLUDE_FILES}
${GTPROXY_SOURCE_FILES})

set_target_properties(${PROJECT_NAME} PROPERTIES
C_STANDARD 11
Expand All @@ -42,16 +37,11 @@ endif ()
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../vendor/proton/shared)

if (GTPROXY_BUILD_VERSION)
set(GTPROXY_VERSION "${CMAKE_PROJECT_VERSION}+${GTPROXY_BUILD_VERSION}")
else ()
set(GTPROXY_VERSION "${CMAKE_PROJECT_VERSION}")
endif ()

target_compile_definitions(${PROJECT_NAME} PUBLIC
NOMINMAX
WIN32_LEAN_AND_MEAN
SPDLOG_FMT_EXTERNAL
CPPHTTPLIB_OPENSSL_SUPPORT
GTPROXY_VERSION="${GTPROXY_VERSION}")

target_link_libraries(${PROJECT_NAME} enet)
Expand All @@ -62,15 +52,16 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/../conan/conan.cmake)
conan_cmake_configure(REQUIRES
fmt/8.1.1
spdlog/1.10.0
cpp-httplib/0.10.7
nlohmann_json/3.10.5
zlib/1.2.12
libressl/3.5.3
GENERATORS cmake_find_package
IMPORTS "bin, *.dll -> ./bin"
OPTIONS
fmt:shared=True
spdlog:shared=True
zlib:shared=True)
zlib:shared=True
libressl:shared=True)

conan_cmake_autodetect(settings)
conan_cmake_install(PATH_OR_REFERENCE .
Expand All @@ -87,11 +78,11 @@ target_link_libraries(${PROJECT_NAME} fmt::fmt)
find_package(spdlog REQUIRED)
target_link_libraries(${PROJECT_NAME} spdlog::spdlog)

find_package(httplib REQUIRED)
target_link_libraries(${PROJECT_NAME} httplib::httplib)

find_package(nlohmann_json REQUIRED)
target_link_libraries(${PROJECT_NAME} nlohmann_json::nlohmann_json)

find_package(ZLIB REQUIRED)
target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB)

find_package(LibreSSL REQUIRED)
target_link_libraries(${PROJECT_NAME} LibreSSL::SSL LibreSSL::TLS LibreSSL::Crypto)
Loading

0 comments on commit eac9050

Please sign in to comment.