Skip to content

Commit

Permalink
Move ztd to FetchContent dep
Browse files Browse the repository at this point in the history
Format
  • Loading branch information
Sirius902 committed Dec 30, 2022
1 parent b3ee2de commit b3d0d5d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "external/include/wil"]
path = external/subproject/wil
url = https://github.com/microsoft/wil.git
[submodule "external/subproject/ztd"]
path = external/subproject/ztd
url = https://github.com/soasis/text.git
[submodule "external/include/tomlplusplus"]
path = external/include/tomlplusplus
url = https://github.com/marzer/tomlplusplus.git
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,22 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
endif()
endif()

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/subproject/ztd/CMakeLists.txt" OR NOT EXISTS "${PROJECT_SOURCE_DIR}/external/subproject/wil/CMakeLists.txt")
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/subproject/wil/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif()

include(FetchContent)

FetchContent_Declare(ztd.text
GIT_REPOSITORY https://github.com/soasis/text.git
GIT_SHALLOW ON
GIT_TAG main)

FetchContent_MakeAvailable(ztd.text)

include_directories(external/include)

add_subdirectory(external/subproject/lua544)
add_subdirectory(external/subproject/ztd)

if(NOT MSVC)
message(FATAL_ERROR "LuaBackendHook must be built using MSVC.")
Expand Down Expand Up @@ -76,7 +84,7 @@ add_custom_target(build-info
)

add_library(DBGHELP SHARED ${SOURCE})
add_dependencies(DBGHELP build-info ztd::text)
add_dependencies(DBGHELP build-info)

target_compile_options(DBGHELP PRIVATE /W4)
target_compile_definitions(DBGHELP PRIVATE -DUNICODE -D_UNICODE)
Expand Down
1 change: 0 additions & 1 deletion external/subproject/ztd
Submodule ztd deleted from cdad52
4 changes: 2 additions & 2 deletions src/main_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ std::optional<GameInfo> gameInfo;
std::uint64_t moduleAddress = 0;

template <ranges::bidirectional_range R>
requires std::same_as<ranges::range_value_t<R>, std::uintptr_t> std::optional<std::uintptr_t> followPointerChain(
std::uintptr_t start, const R& offsets) {
requires std::same_as<ranges::range_value_t<R>, std::uintptr_t>
std::optional<std::uintptr_t> followPointerChain(std::uintptr_t start, const R& offsets) {
std::uintptr_t current = start;

for (auto it = ranges::begin(offsets); it != ranges::end(offsets); ++it) {
Expand Down

0 comments on commit b3d0d5d

Please sign in to comment.