From 13454ba6884e444b69b6d0f5c7b1da3dfc17f26e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 27 Mar 2022 21:48:50 -0400 Subject: [PATCH] Further improve Windows support --- CMakeLists.txt | 16 +++++++++++++--- include/{crc32.h => crc32checksum.h} | 0 src/{crc32.cpp => crc32checksum.cpp} | 2 +- src/gamedata.cpp | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) rename include/{crc32.h => crc32checksum.h} (100%) rename src/{crc32.cpp => crc32checksum.cpp} (96%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 960fcc5..8490a47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ project(libxiv) +include(FetchContent) + find_package(fmt QUIET) if(TARGET fmt::fmt) @@ -15,6 +17,8 @@ else() GIT_TAG master ) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(fmt) set(LIBRARIES fmt::fmt ${LIBRARIES}) @@ -41,16 +45,22 @@ else() GIT_TAG master ) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(zlib) - set(LIBRARIES zlib ${LIBRARIES}) -endif() + # welcome to hell, cmake. + include_directories(${CMAKE_BINARY_DIR}/_deps/zlib-src) + # NO REALLY, HELL IS THIS WAY + include_directories(${CMAKE_BINARY_DIR}/_deps/zlib-build) + set(LIBRARIES zlibstatic ${LIBRARIES}) +endif() add_library(libxiv STATIC src/fiinparser.cpp src/indexparser.cpp - src/crc32.cpp + src/crc32checksum.cpp src/gamedata.cpp src/compression.cpp src/exhparser.cpp diff --git a/include/crc32.h b/include/crc32checksum.h similarity index 100% rename from include/crc32.h rename to include/crc32checksum.h diff --git a/src/crc32.cpp b/src/crc32checksum.cpp similarity index 96% rename from src/crc32.cpp rename to src/crc32checksum.cpp index bda444b..6c5e544 100644 --- a/src/crc32.cpp +++ b/src/crc32checksum.cpp @@ -1,4 +1,4 @@ -#include "crc32.h" +#include "crc32checksum.h" void CRC32::generate_table(uint32_t(&table)[256]) { uint32_t polynomial = 0xEDB88320; diff --git a/src/gamedata.cpp b/src/gamedata.cpp index 68bbe0a..ccc5000 100644 --- a/src/gamedata.cpp +++ b/src/gamedata.cpp @@ -1,6 +1,6 @@ #include "gamedata.h" #include "indexparser.h" -#include "crc32.h" +#include "crc32checksum.h" #include "compression.h" #include "string_utils.h"