Convert dependencies to submodules.

This commit is contained in:
Skyth 2024-12-17 15:01:18 +03:00
parent b9c6b36a4d
commit 14b7fd3445
10 changed files with 53 additions and 31 deletions

9
.gitmodules vendored Normal file
View file

@ -0,0 +1,9 @@
[submodule "thirdparty/xxHash"]
path = thirdparty/xxHash
url = https://github.com/Cyan4973/xxHash.git
[submodule "thirdparty/fmt"]
path = thirdparty/fmt
url = https://github.com/fmtlib/fmt.git
[submodule "thirdparty/tomlplusplus"]
path = thirdparty/tomlplusplus
url = https://github.com/marzer/tomlplusplus.git

View file

@ -1,6 +1,5 @@
cmake_minimum_required (VERSION 3.20) cmake_minimum_required (VERSION 3.20)
include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
set(THIRDPARTY_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty) set(THIRDPARTY_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
@ -16,10 +15,10 @@ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
include("cmake/bin2h.cmake") include("cmake/bin2h.cmake")
add_subdirectory(${THIRDPARTY_ROOT}/disasm) add_subdirectory(${THIRDPARTY_ROOT})
set(POWERANALYSE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerAnalyse) set(POWERANALYSE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerAnalyse)
set(POWERRECOMP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerRecomp)
set(POWERUTILS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerUtils) set(POWERUTILS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerUtils)
set(POWERRECOMP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerRecomp)
project ("PowerRecomp-ALL") project ("PowerRecomp-ALL")

View file

@ -2,12 +2,13 @@
project("PowerAnalyse") project("PowerAnalyse")
add_executable(PowerAnalyse "main.cpp" "function.h" "function.cpp") add_executable(PowerAnalyse
add_library(LibPowerAnalyse "function.h" "function.cpp") "main.cpp"
"function.cpp")
find_package(fmt CONFIG REQUIRED)
target_include_directories(LibPowerAnalyse PUBLIC .)
target_link_libraries(LibPowerAnalyse PUBLIC PowerUtils)
target_link_libraries(PowerAnalyse PRIVATE PowerUtils fmt::fmt) target_link_libraries(PowerAnalyse PRIVATE PowerUtils fmt::fmt)
add_library(LibPowerAnalyse "function.cpp")
target_include_directories(LibPowerAnalyse PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(LibPowerAnalyse PUBLIC PowerUtils)

View file

@ -364,7 +364,7 @@ int main()
if (f.base == 0x82BD7420) if (f.base == 0x82BD7420)
{ {
__debugbreak(); __builtin_debugtrap();
} }
image.symbols.emplace(fmt::format("sub_{:X}", f.base), f.base, f.size, Symbol_Function); image.symbols.emplace(fmt::format("sub_{:X}", f.base), f.base, f.size, Symbol_Function);

View file

@ -2,17 +2,26 @@ cmake_minimum_required (VERSION 3.8)
project("PowerRecomp") project("PowerRecomp")
BIN2H(SOURCE_FILE ${POWERUTILS_ROOT}/ppc_context.h HEADER_FILE "generated/ppc_context.gen.h" ARRAY_TYPE "char" VARIABLE_NAME "g_PPCContextText") BIN2H(SOURCE_FILE
${POWERUTILS_ROOT}/ppc_context.h
HEADER_FILE "generated/ppc_context.gen.h"
ARRAY_TYPE "char"
VARIABLE_NAME "g_PPCContextText")
add_executable(PowerRecomp
"main.cpp"
"recompiler.cpp"
"test_recompiler.cpp"
"recompiler_config.cpp")
add_executable(PowerRecomp "main.cpp" "pch.h" "recompiler.cpp" "recompiler.h" "test_recompiler.cpp" "test_recompiler.h" "recompiler_config.h" "recompiler_config.cpp")
target_precompile_headers(PowerRecomp PUBLIC "pch.h") target_precompile_headers(PowerRecomp PUBLIC "pch.h")
find_package(fmt CONFIG REQUIRED) target_link_libraries(PowerRecomp PRIVATE
find_package(PkgConfig REQUIRED) LibPowerAnalyse
pkg_check_modules(tomlplusplus REQUIRED IMPORTED_TARGET tomlplusplus) PowerUtils
find_package(xxHash CONFIG REQUIRED) fmt::fmt
tomlplusplus::tomlplusplus
target_link_libraries(PowerRecomp PRIVATE LibPowerAnalyse fmt::fmt PkgConfig::tomlplusplus xxHash::xxhash) xxHash::xxhash)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(PowerRecomp PRIVATE -Wno-switch -Wno-unused-variable -Wno-null-arithmetic) target_compile_options(PowerRecomp PRIVATE -Wno-switch -Wno-unused-variable -Wno-null-arithmetic)

13
thirdparty/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,13 @@
add_subdirectory(${THIRDPARTY_ROOT}/disasm)
if (NOT TARGET fmt::fmt)
add_subdirectory(${THIRDPARTY_ROOT}/fmt)
endif()
if (NOT TARGET tomlplusplus::tomlplusplus)
add_subdirectory(${THIRDPARTY_ROOT}/tomlplusplus)
endif()
if (NOT TARGET xxHash::xxhash)
add_subdirectory(${THIRDPARTY_ROOT}/xxHash/cmake_unofficial)
endif()

1
thirdparty/fmt vendored Submodule

@ -0,0 +1 @@
Subproject commit 873670ba3f9e7bc77ec2c1c94b04f1f8bef77e9f

1
thirdparty/tomlplusplus vendored Submodule

@ -0,0 +1 @@
Subproject commit c4369ae1d8955cae20c4ab40b9813ef4b60e48be

1
thirdparty/xxHash vendored Submodule

@ -0,0 +1 @@
Subproject commit 2bf8313b934633b2a5b7e8fd239645b85e10c852

View file

@ -1,12 +0,0 @@
{
"builtin-baseline": "e63bd09dc0b7204467705c1c7c71d0e2a3f8860b",
"dependencies": [
{
"name": "pkgconf",
"platform": "windows"
},
"fmt",
"tomlplusplus",
"xxhash"
]
}