Skip to content

Commit

Permalink
Updated project and dependencies, changed license
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelonn committed Feb 17, 2024
1 parent db15e8c commit a15986a
Show file tree
Hide file tree
Showing 16,536 changed files with 86,200 additions and 1,099,984 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
15 changes: 5 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
build
# CLion build directory
/cmake-build-**
build-wsl
.vscode
.idea
zconf.h
curl_config.h
tools/block-generator/res
tools/block-generator/generated
fix_licenses.py
tools/item-generator/res
tools/item-generator/generated
tools/dump-data/data
.vscode/
.idea/
venv/
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[submodule "Source/ThirdParty/curl/curl"]
path = Source/ThirdParty/curl/curl
url = https://github.com/curl/curl
[submodule "Source/ThirdParty/GSL"]
path = Source/ThirdParty/GSL
url = https://github.com/microsoft/GSL
[submodule "Source/ThirdParty/libdeflate"]
path = Source/ThirdParty/libdeflate
url = https://github.com/ebiggers/libdeflate
[submodule "Source/ThirdParty/nlohmann_json/json"]
path = Source/ThirdParty/nlohmann_json/json
url = https://github.com/nlohmann/json
[submodule "Source/ThirdParty/rapidyaml"]
path = Source/ThirdParty/rapidyaml
url = https://github.com/biojppm/rapidyaml
[submodule "Source/ThirdParty/asio/asio"]
path = Source/ThirdParty/asio/asio
url = https://github.com/chriskohlhoff/asio
54 changes: 21 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
cmake_minimum_required(VERSION 3.20)
project(Mycelium)

project(Mycelium LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_subdirectory(thirdparty/rapidyaml)
include_directories(thirdparty/rapidyaml/src)

include_directories(thirdparty/asio/include)

set(LIBDEFLATE_BUILD_SHARED_LIB OFF)
set(BUILD_SHARED_LIBS OFF)

add_subdirectory(thirdparty/libnoise)
include_directories(thirdparty/libnoise/src)

add_subdirectory(thirdparty/libdeflate)
include_directories(thirdparty/libdeflate)
add_subdirectory(Source/ThirdParty/asio)
add_subdirectory(Source/ThirdParty/curl)
add_subdirectory(Source/ThirdParty/GSL)
add_subdirectory(Source/ThirdParty/libdeflate)
add_subdirectory(Source/ThirdParty/nlohmann_json)
add_subdirectory(Source/ThirdParty/rapidyaml)

find_package(PkgConfig REQUIRED)
find_package(OpenSSL REQUIRED)

pkg_search_module(CURL REQUIRED libcurl)
include_directories(${CURL_INCLUDE_DIRS})
link_directories(${CURL_LIBRARY_DIRS})
message(STATUS "Using libcurl ${CURL_VERSION}")
file(GLOB_RECURSE CORE_SOURCES Source/Runtime/**/*.cpp)

pkg_search_module(OPENSSL REQUIRED openssl)
include_directories(${OPENSSL_INCLUDE_DIRS})
link_directories(${OPENSSL_LIBRARY_DIRS})
message(STATUS "Using OpenSSL ${OPENSSL_VERSION}")

file(GLOB_RECURSE SRC src/*.cpp)

add_executable(Mycelium ${SRC})
target_link_libraries(Mycelium ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} libdeflate ryml::ryml noise-static)
add_executable(Mycelium ${CORE_SOURCES} Source/ThirdParty/uuid.h Source/ThirdParty/PerlinNoise.h)
target_link_libraries(Mycelium
OpenSSL::SSL
OpenSSL::Crypto
asio::asio
libcurl
Microsoft.GSL::GSL
libdeflate_static
nlohmann_json::nlohmann_json
ryml::ryml)

if (WIN32)
target_link_libraries(Mycelium wsock32)
endif ()

find_package(Python COMPONENTS Interpreter)

add_custom_target(
check_license
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/check_license.py
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Checking license..."
)
add_dependencies(Mycelium check_license)

add_custom_command(TARGET Mycelium POST_BUILD
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/copy_resources.py ${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Expand Down
Loading

0 comments on commit a15986a

Please sign in to comment.