Convert majority of dependencies to submodules. (#48)

* Convert majority of dependencies to submodules.

* Don't compile header-only libraries.
This commit is contained in:
Skyth (Asilkan) 2024-12-17 15:35:18 +03:00 committed by GitHub
parent af8c01f590
commit 82f6548f8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 542 additions and 511 deletions

42
.gitmodules vendored
View file

@ -22,3 +22,45 @@
[submodule "thirdparty/vcpkg"] [submodule "thirdparty/vcpkg"]
path = thirdparty/vcpkg path = thirdparty/vcpkg
url = https://github.com/microsoft/vcpkg url = https://github.com/microsoft/vcpkg
[submodule "thirdparty/volk"]
path = thirdparty/volk
url = https://github.com/zeux/volk
[submodule "thirdparty/SDL"]
path = thirdparty/SDL
url = https://github.com/libsdl-org/SDL.git
[submodule "thirdparty/Vulkan-Headers"]
path = thirdparty/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git
[submodule "thirdparty/VulkanMemoryAllocator"]
path = thirdparty/VulkanMemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
[submodule "thirdparty/D3D12MemoryAllocator"]
path = thirdparty/D3D12MemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator.git
[submodule "thirdparty/stb"]
path = thirdparty/stb
url = https://github.com/nothings/stb.git
[submodule "thirdparty/concurrentqueue"]
path = thirdparty/concurrentqueue
url = https://github.com/cameron314/concurrentqueue.git
[submodule "thirdparty/tiny-AES-c"]
path = thirdparty/tiny-AES-c
url = https://github.com/kokke/tiny-AES-c.git
[submodule "thirdparty/magic_enum"]
path = thirdparty/magic_enum
url = https://github.com/Neargye/magic_enum.git
[submodule "thirdparty/nativefiledialog-extended"]
path = thirdparty/nativefiledialog-extended
url = https://github.com/btzy/nativefiledialog-extended.git
[submodule "thirdparty/imgui"]
path = thirdparty/imgui
url = https://github.com/ocornut/imgui.git
[submodule "thirdparty/unordered_dense"]
path = thirdparty/unordered_dense
url = https://github.com/martinus/unordered_dense.git
[submodule "thirdparty/vorbis"]
path = thirdparty/vorbis
url = https://gitlab.xiph.org/xiph/vorbis.git
[submodule "thirdparty/ogg"]
path = thirdparty/ogg
url = https://gitlab.xiph.org/xiph/ogg.git

View file

@ -16,6 +16,9 @@
"type": "FILEPATH" "type": "FILEPATH"
} }
}, },
"environment": {
"VCPKG_ROOT": "${sourceDir}/thirdparty/vcpkg"
},
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",

View file

@ -50,6 +50,7 @@ add_compile_options(
-Wno-invalid-offsetof -Wno-invalid-offsetof
-Wno-null-arithmetic -Wno-null-arithmetic
-Wno-null-conversion -Wno-null-conversion
-Wno-tautological-undefined-compare
) )
if (WIN32) if (WIN32)
@ -184,24 +185,48 @@ set(SWA_INSTALL_CXX_SOURCES
"install/hashes/update.cpp" "install/hashes/update.cpp"
) )
set(LIBMSPACK_PATH ${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack)
set(LIBMSPACK_C_SOURCES
${LIBMSPACK_PATH}/lzxd.c
)
set_source_files_properties(${LIBMSPACK_C_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
set(SMOLV_SOURCE_DIR "${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source")
set(BC_DIFF_SOURCE_DIR "${SWA_TOOLS_ROOT}/bc_diff")
set(MINIAUDIO_INCLUDE_DIRS "${SWA_THIRDPARTY_ROOT}/miniaudio")
set(SWA_USER_CXX_SOURCES set(SWA_USER_CXX_SOURCES
"user/achievement_data.cpp" "user/achievement_data.cpp"
"user/config.cpp" "user/config.cpp"
) )
set(SWA_THIRDPARTY_SOURCES
"${SWA_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp"
"${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c"
"${SWA_THIRDPARTY_ROOT}/tiny-AES-c/aes.c"
"${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source/smolv.cpp"
)
set(SWA_THIRDPARTY_INCLUDES
"${SWA_THIRDPARTY_ROOT}/concurrentqueue"
"${SWA_THIRDPARTY_ROOT}/ddspp"
"${SWA_THIRDPARTY_ROOT}/imgui"
"${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack"
"${SWA_THIRDPARTY_ROOT}/magic_enum/include"
"${SWA_THIRDPARTY_ROOT}/miniaudio"
"${SWA_THIRDPARTY_ROOT}/stb"
"${SWA_THIRDPARTY_ROOT}/tiny-AES-c"
"${SWA_THIRDPARTY_ROOT}/TinySHA1"
"${SWA_THIRDPARTY_ROOT}/unordered_dense/include"
"${SWA_THIRDPARTY_ROOT}/volk"
"${SWA_THIRDPARTY_ROOT}/Vulkan-Headers/include"
"${SWA_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include"
"${SWA_TOOLS_ROOT}/bc_diff"
"${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source"
)
if (SWA_D3D12)
list(APPEND SWA_THIRDPARTY_INCLUDES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include")
list(APPEND SWA_THIRDPARTY_SOURCES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp")
endif()
set_source_files_properties(${SWA_THIRDPARTY_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
set(SWA_CXX_SOURCES set(SWA_CXX_SOURCES
"app.cpp" "app.cpp"
"exports.cpp" "exports.cpp"
@ -219,9 +244,8 @@ set(SWA_CXX_SOURCES
${SWA_PATCHES_CXX_SOURCES} ${SWA_PATCHES_CXX_SOURCES}
${SWA_UI_CXX_SOURCES} ${SWA_UI_CXX_SOURCES}
${SWA_INSTALL_CXX_SOURCES} ${SWA_INSTALL_CXX_SOURCES}
${LIBMSPACK_C_SOURCES}
"${SMOLV_SOURCE_DIR}/smolv.cpp"
${SWA_USER_CXX_SOURCES} ${SWA_USER_CXX_SOURCES}
${SWA_THIRDPARTY_SOURCES}
) )
if (WIN32) if (WIN32)
@ -238,28 +262,10 @@ set_target_properties(UnleashedRecomp PROPERTIES OUTPUT_NAME ${TARGET_NAME})
if (SWA_D3D12) if (SWA_D3D12)
find_package(directx-headers CONFIG REQUIRED) find_package(directx-headers CONFIG REQUIRED)
find_package(directx12-agility CONFIG REQUIRED) find_package(directx12-agility CONFIG REQUIRED)
find_package(d3d12-memory-allocator CONFIG REQUIRED)
target_compile_definitions(UnleashedRecomp PRIVATE SWA_D3D12) target_compile_definitions(UnleashedRecomp PRIVATE SWA_D3D12)
endif() endif()
find_package(SDL2 CONFIG REQUIRED)
find_package(unordered_dense CONFIG REQUIRED)
find_package(VulkanHeaders CONFIG)
find_package(volk CONFIG REQUIRED)
find_package(VulkanMemoryAllocator CONFIG REQUIRED)
find_package(xxHash CONFIG REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(tomlplusplus REQUIRED IMPORTED_TARGET tomlplusplus)
find_package(directx-dxc REQUIRED) find_package(directx-dxc REQUIRED)
find_package(zstd CONFIG REQUIRED)
find_package(Stb REQUIRED)
find_package(unofficial-concurrentqueue REQUIRED)
find_package(imgui CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)
find_package(unofficial-tiny-aes-c CONFIG REQUIRED)
find_package(nfd CONFIG REQUIRED)
find_package(Vorbis CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
if (SWA_D3D12) if (SWA_D3D12)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
@ -276,7 +282,7 @@ if (SWA_D3D12)
Microsoft::DirectX-Guids Microsoft::DirectX-Guids
Microsoft::DirectX12-Agility Microsoft::DirectX12-Agility
Microsoft::DirectXShaderCompiler Microsoft::DirectXShaderCompiler
unofficial::D3D12MemoryAllocator Microsoft::DXIL
dxgi dxgi
) )
endif() endif()
@ -293,38 +299,22 @@ if (WIN32)
endif() endif()
target_link_libraries(UnleashedRecomp PRIVATE target_link_libraries(UnleashedRecomp PRIVATE
Vulkan::Headers fmt::fmt
volk::volk libzstd_static
volk::volk_headers msdf-atlas-gen::msdf-atlas-gen
GPUOpen::VulkanMemoryAllocator nfd::nfd
o1heap o1heap
PowerUtils PowerUtils
SDL2::SDL2-static SDL2::SDL2-static
tomlplusplus::tomlplusplus
UnleashedRecompLib UnleashedRecompLib
unordered_dense::unordered_dense
xxHash::xxhash
PkgConfig::tomlplusplus
zstd::libzstd_static
unofficial::concurrentqueue::concurrentqueue
imgui::imgui
magic_enum::magic_enum
unofficial::tiny-aes-c::tiny-aes-c
nfd::nfd
msdf-atlas-gen::msdf-atlas-gen
Vorbis::vorbisfile Vorbis::vorbisfile
fmt::fmt xxHash::xxhash )
)
target_include_directories(UnleashedRecomp PRIVATE target_include_directories(UnleashedRecomp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/api "${CMAKE_CURRENT_SOURCE_DIR}/api"
${SWA_THIRDPARTY_ROOT}/ddspp ${SWA_THIRDPARTY_INCLUDES}
${SWA_THIRDPARTY_ROOT}/TinySHA1
${LIBMSPACK_PATH}
${Stb_INCLUDE_DIR}
${SMOLV_SOURCE_DIR}
${MINIAUDIO_INCLUDE_DIRS}
${BC_DIFF_SOURCE_DIR}
) )
if (CMAKE_SYSTEM_NAME MATCHES "Linux") if (CMAKE_SYSTEM_NAME MATCHES "Linux")

View file

@ -22,9 +22,18 @@
#define VK_USE_PLATFORM_XLIB_KHR #define VK_USE_PLATFORM_XLIB_KHR
#endif #endif
#include "volk.h" #include <volk.h>
#include "vk_mem_alloc.h" #ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"
#endif
#include <vk_mem_alloc.h>
#ifdef __clang__
#pragma clang diagnostic pop
#endif
namespace plume { namespace plume {
struct VulkanCommandQueue; struct VulkanCommandQueue;

View file

@ -31,7 +31,7 @@
#include <xxHashMap.h> #include <xxHashMap.h>
#if defined(ASYNC_PSO_DEBUG) || defined(PSO_CACHING) #if defined(ASYNC_PSO_DEBUG) || defined(PSO_CACHING)
#include <magic_enum.hpp> #include <magic_enum/magic_enum.hpp>
#endif #endif
#include "../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" #include "../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
//#define ASYNC_PSO_DEBUG //#define ASYNC_PSO_DEBUG
//#define PSO_CACHING #define PSO_CACHING
#include "rhi/plume_render_interface.h" #include "rhi/plume_render_interface.h"

View file

@ -34,11 +34,11 @@ using Microsoft::WRL::ComPtr;
#include <toml++/toml.hpp> #include <toml++/toml.hpp>
#include <zstd.h> #include <zstd.h>
#include <stb_image.h> #include <stb_image.h>
#include <concurrentqueue/blockingconcurrentqueue.h> #include <blockingconcurrentqueue.h>
#include <SDL.h> #include <SDL.h>
#include <imgui.h> #include <imgui.h>
#include <imgui_internal.h> #include <imgui_internal.h>
#include <imgui_impl_sdl2.h> #include <backends/imgui_impl_sdl2.h>
#include <o1heap.h> #include <o1heap.h>
#include <cstddef> #include <cstddef>
#include <smolv.h> #include <smolv.h>

View file

@ -3,5 +3,9 @@ set(MSDF_ATLAS_USE_SKIA OFF)
set(MSDF_ATLAS_NO_ARTERY_FONT ON) set(MSDF_ATLAS_NO_ARTERY_FONT ON)
set(MSDFGEN_DISABLE_PNG ON) set(MSDFGEN_DISABLE_PNG ON)
add_subdirectory(${SWA_THIRDPARTY_ROOT}/o1heap) add_subdirectory("${SWA_THIRDPARTY_ROOT}/msdf-atlas-gen")
add_subdirectory(${SWA_THIRDPARTY_ROOT}/msdf-atlas-gen) add_subdirectory("${SWA_THIRDPARTY_ROOT}/nativefiledialog-extended")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/ogg")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/o1heap")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/SDL")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/vorbis")

1
thirdparty/D3D12MemoryAllocator vendored Submodule

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

1
thirdparty/SDL vendored Submodule

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

1
thirdparty/Vulkan-Headers vendored Submodule

@ -0,0 +1 @@
Subproject commit 14345dab231912ee9601136e96ca67a6e1f632e7

1
thirdparty/VulkanMemoryAllocator vendored Submodule

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

1
thirdparty/concurrentqueue vendored Submodule

@ -0,0 +1 @@
Subproject commit 6dd38b8a1dbaa7863aa907045f32308a56a6ff5d

1
thirdparty/imgui vendored Submodule

@ -0,0 +1 @@
Subproject commit 8199457a7d9e453f8d3d9cadc14683fb54a858b5

1
thirdparty/magic_enum vendored Submodule

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

@ -0,0 +1 @@
Subproject commit 388549a5badaa7cbd138f5f189f50c67d5bf060c

1
thirdparty/ogg vendored Submodule

@ -0,0 +1 @@
Subproject commit 7cf42ea17aef7bc1b7b21af70724840a96c2e7d0

1
thirdparty/stb vendored Submodule

@ -0,0 +1 @@
Subproject commit 5c205738c191bcb0abc65c4febfa9bd25ff35234

1
thirdparty/tiny-AES-c vendored Submodule

@ -0,0 +1 @@
Subproject commit 23856752fbd139da0b8ca6e471a13d5bcc99a08d

1
thirdparty/unordered_dense vendored Submodule

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

2
thirdparty/vcpkg vendored

@ -1 +1 @@
Subproject commit 5b55679a998403bcd570c0eb867a8bd378f21bcb Subproject commit b322364f06308bdd24823f9d8f03fe0cc86fd46f

1
thirdparty/volk vendored Submodule

@ -0,0 +1 @@
Subproject commit 447e21b5d92ed8d5271b0d39b071f938fcfa875f

1
thirdparty/vorbis vendored Submodule

@ -0,0 +1 @@
Subproject commit 84c023699cdf023a32fa4ded32019f194afcdad0

@ -1 +1 @@
Subproject commit b9c6b36a4d9c18134face14976e5e9c98cf5f113 Subproject commit 14b7fd3445857a44ad91b832592cffb069451e4f

@ -1 +1 @@
Subproject commit 20bf4654480aad68940c2bf019f2fc7cdde60b79 Subproject commit cf44a5e6fb7c9931888ee4e6506109787141f87e

View file

@ -6,5 +6,4 @@ set(CMAKE_CXX_STANDARD 17)
add_executable(bc_diff "bc_diff.cpp") add_executable(bc_diff "bc_diff.cpp")
add_compile_definitions(bc_diff PRIVATE _CRT_SECURE_NO_WARNINGS) add_compile_definitions(bc_diff PRIVATE _CRT_SECURE_NO_WARNINGS)
find_package(xxHash CONFIG REQUIRED)
target_link_libraries(bc_diff PRIVATE xxHash::xxhash) target_link_libraries(bc_diff PRIVATE xxHash::xxhash)

View file

@ -7,5 +7,4 @@ set(CMAKE_CXX_STANDARD 17)
add_executable(file_to_c "file_to_c.cpp") add_executable(file_to_c "file_to_c.cpp")
find_package(zstd CONFIG REQUIRED) target_link_libraries(file_to_c PRIVATE $<IF:$<TARGET_EXISTS:libzstd_static>,libzstd_static,libzstd_shared>)
target_link_libraries(file_to_c PRIVATE $<IF:$<TARGET_EXISTS:zstd::libzstd_static>,zstd::libzstd_static,zstd::libzstd>)

View file

@ -2,6 +2,4 @@ project("fshasher")
add_executable(fshasher "fshasher.cpp") add_executable(fshasher "fshasher.cpp")
find_package(xxHash CONFIG REQUIRED)
target_link_libraries(fshasher PRIVATE xxHash::xxhash) target_link_libraries(fshasher PRIVATE xxHash::xxhash)

View file

@ -1,5 +1,5 @@
{ {
"builtin-baseline": "5b55679a998403bcd570c0eb867a8bd378f21bcb", "builtin-baseline": "b322364f06308bdd24823f9d8f03fe0cc86fd46f",
"dependencies": [ "dependencies": [
{ {
"name": "directx-headers", "name": "directx-headers",
@ -9,34 +9,7 @@
"name": "directx12-agility", "name": "directx12-agility",
"platform": "windows" "platform": "windows"
}, },
{
"name": "d3d12-memory-allocator",
"platform": "windows"
},
{
"name": "pkgconf",
"platform": "windows"
},
{
"name": "imgui",
"features": [ "sdl2-binding" ]
},
"directx-dxc", "directx-dxc",
"sdl2", "freetype"
"unordered-dense",
"volk",
"vulkan-headers",
"vulkan-memory-allocator",
"xxhash",
"tomlplusplus",
"zstd",
"stb",
"concurrentqueue",
"tiny-aes-c",
"magic-enum",
"nativefiledialog-extended",
"freetype",
"libvorbis",
"fmt"
] ]
} }