[cmake] refactor: CPM over vcpkg (#250)

Completely replaces vcpkg with CPM for all "system" dependencies. Primarily needed for Android and Windows. Also uses my OpenSSL CI for those two platforms.

In theory, improves configure and build time by a LOT and makes things much easier to manage

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/250
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
This commit is contained in:
crueter 2025-08-14 20:30:30 +02:00
parent c36cc0d3ee
commit 3e55dc6352
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
67 changed files with 584 additions and 10752 deletions

View file

@ -261,9 +261,24 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
)
endif()
target_link_libraries(common PUBLIC Boost::headers fmt::fmt
stb::headers Threads::Threads)
target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
if (BOOST_NO_HEADERS)
target_link_libraries(common PUBLIC Boost::algorithm Boost::icl Boost::pool)
else()
target_link_libraries(common PUBLIC Boost::headers)
endif()
if (lz4_ADDED)
target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib)
endif()
target_link_libraries(common PUBLIC fmt::fmt stb::headers Threads::Threads)
target_link_libraries(common PRIVATE lz4::lz4 LLVM::Demangle)
if (TARGET libzstd_static)
target_link_libraries(common PRIVATE libzstd_static)
else()
target_link_libraries(common PRIVATE zstd)
endif()
if(ANDROID)
# For ASharedMemory_create

View file

@ -183,18 +183,18 @@ public:
FileType type = FileType::BinaryFile,
FileShareFlag flag = FileShareFlag::ShareReadOnly);
#ifdef _WIN32
template <typename Path>
void Open(const Path& path, FileAccessMode mode, FileType type = FileType::BinaryFile,
FileShareFlag flag = FileShareFlag::ShareReadOnly) {
using ValueType = typename Path::value_type;
if constexpr (IsChar<ValueType>) {
Open(ToU8String(path), mode, type, flag);
} else {
Open(std::filesystem::path{path}, mode, type, flag);
}
}
#endif
// #ifdef _WIN32
// template <typename Path>
// void Open(const Path& path, FileAccessMode mode, FileType type = FileType::BinaryFile,
// FileShareFlag flag = FileShareFlag::ShareReadOnly) {
// using ValueType = typename Path::value_type;
// if constexpr (IsChar<ValueType>) {
// Open(ToU8String(path), mode, type, flag);
// } else {
// Open(std::filesystem::path{path}, mode, type, flag);
// }
// }
// #endif
/// Closes the file if it is opened.
void Close();