diff --git a/CMakeLists.txt b/CMakeLists.txt index 8490a47..4571e06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,11 @@ endif() # note: unshield does not work on windows per maintainer notice in README, so we might as well not even attempt to look # for it. if(NOT WIN32) - set(LIBRARIES unshield ${LIBRARIES}) + find_package(PkgConfig REQUIRED) + pkg_check_modules(libunshield REQUIRED libunshield) + + set(LIBRARIES ${libunshield_LIBRARIES} ${LIBRARIES}) + set(LIB_DIRS ${libunshield_LIBRARY_DIRS}) endif() find_package(ZLIB QUIET) @@ -68,5 +72,5 @@ add_library(libxiv STATIC src/installextract.cpp src/patch.cpp) target_include_directories(libxiv PUBLIC include PRIVATE src) -target_link_libraries(libxiv PUBLIC - ${LIBRARIES}) \ No newline at end of file +target_link_libraries(libxiv PUBLIC ${LIBRARIES}) +target_link_directories(libxiv PUBLIC ${LIB_DIRS}) \ No newline at end of file diff --git a/src/exhparser.cpp b/src/exhparser.cpp index 758127c..cb007d3 100644 --- a/src/exhparser.cpp +++ b/src/exhparser.cpp @@ -5,6 +5,7 @@ #include #include #include +#include EXH readEXH(const std::string_view path) { EXH exh; diff --git a/src/indexparser.cpp b/src/indexparser.cpp index 45d4ad1..7bf674d 100644 --- a/src/indexparser.cpp +++ b/src/indexparser.cpp @@ -3,6 +3,7 @@ #include #include #include +#include template void commonParseSqPack(FILE* file, IndexFile& index) {