Skip to content

Commit

Permalink
Fix: par2-turbo build
Browse files Browse the repository at this point in the history
  • Loading branch information
dnzbk committed Dec 26, 2024
1 parent c66afad commit 9f0857f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
31 changes: 16 additions & 15 deletions cmake/par2-turbo.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
set(PAR2_ROOT ${CMAKE_BINARY_DIR}/par2-turbo/src)
if(WIN32)
set(PAR2_LIBS
${PAR2_ROOT}/par2-turbo-build/${CMAKE_BUILD_TYPE}/par2-turbo.lib
${PAR2_ROOT}/par2-turbo-build/${CMAKE_BUILD_TYPE}/gf16.lib
${PAR2_ROOT}/par2-turbo-build/${CMAKE_BUILD_TYPE}/hasher.lib
)
else()
set(PAR2_LIBS
${PAR2_ROOT}/par2-turbo-build/libpar2-turbo.a
${PAR2_ROOT}/par2-turbo-build/libgf16.a
${PAR2_ROOT}/par2-turbo-build/libhasher.a
)
endif()

add_compile_definitions(HAVE_CONFIG_H PARPAR_ENABLE_HASHER_MD5CRC)

Expand Down Expand Up @@ -33,22 +46,10 @@ ExternalProject_add(
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
CMAKE_ARGS ${CMAKE_ARGS}
BUILD_BYPRODUCTS ${PAR2_LIBS}
CMAKE_ARGS ${CMAKE_ARGS}
INSTALL_COMMAND ""
)

if(WIN32)
set(LIBS ${LIBS}
${PAR2_ROOT}/par2-turbo-build/${CMAKE_BUILD_TYPE}/par2-turbo.lib
${PAR2_ROOT}/par2-turbo-build/${CMAKE_BUILD_TYPE}/gf16.lib
${PAR2_ROOT}/par2-turbo-build/${CMAKE_BUILD_TYPE}/hasher.lib
)
else()
set(LIBS ${LIBS}
${PAR2_ROOT}/par2-turbo-build/libpar2-turbo.a
${PAR2_ROOT}/par2-turbo-build/libgf16.a
${PAR2_ROOT}/par2-turbo-build/libhasher.a
)
endif()

set(LIBS ${LIBS} ${PAR2_LIBS})
set(INCLUDES ${INCLUDES} ${PAR2_ROOT}/par2-turbo/include)
15 changes: 10 additions & 5 deletions tests/postprocess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ set(PostprocessTestsSrc
main.cpp
# DirectUnpackTest.cpp
# DupeMatcherTest.cpp
ParCheckerTest.cpp
ParRenamerTest.cpp
RarReaderTest.cpp
RarRenamerTest.cpp
../suite/TestUtil.cpp
# ${CMAKE_SOURCE_DIR}/daemon/postprocess/DirectUnpack.cpp
# ${CMAKE_SOURCE_DIR}/daemon/postprocess/DupeMatcher.cpp
${CMAKE_SOURCE_DIR}/daemon/postprocess/ParChecker.cpp
${CMAKE_SOURCE_DIR}/daemon/postprocess/ParParser.cpp
${CMAKE_SOURCE_DIR}/daemon/postprocess/ParRenamer.cpp
${CMAKE_SOURCE_DIR}/daemon/postprocess/RarReader.cpp
${CMAKE_SOURCE_DIR}/daemon/postprocess/RarRenamer.cpp
${CMAKE_SOURCE_DIR}/daemon/main/Options.cpp
Expand All @@ -25,6 +20,16 @@ set(PostprocessTestsSrc
${CMAKE_SOURCE_DIR}/daemon/queue/DiskState.cpp
)

if(NOT DISABLE_PARCHECK)
set(PostprocessTestsSrc ${PostprocessTestsSrc}
ParCheckerTest.cpp
ParRenamerTest.cpp
${CMAKE_SOURCE_DIR}/daemon/postprocess/ParChecker.cpp
${CMAKE_SOURCE_DIR}/daemon/postprocess/ParParser.cpp
${CMAKE_SOURCE_DIR}/daemon/postprocess/ParRenamer.cpp
)
endif()

if(WIN32)
set(PostprocessTestsSrc ${PostprocessTestsSrc} ${CMAKE_SOURCE_DIR}/daemon/util/Utf8.cpp)
endif()
Expand Down

0 comments on commit 9f0857f

Please sign in to comment.