Skip to content

Commit

Permalink
Fix blake3 linking on windows + fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmarslender committed Oct 20, 2023
1 parent bf43637 commit 63a2824
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
ProofOfSpace
RunTests
HellmanAttacks
Expand Down
18 changes: 13 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,15 @@ FetchContent_GetProperties(blake3)
if(NOT blake3_POPULATED)
FetchContent_Populate(blake3)

# Set BLAKE3 to build as a shared library
set(BUILD_SHARED_LIBS TRUE CACHE BOOL "Build shared libraries" FORCE)
# Set BLAKE3 to build as a static library
set(BUILD_SHARED_LIBS FALSE CACHE BOOL "Build static libraries" FORCE)

add_subdirectory(${blake3_SOURCE_DIR}/c ${blake3_BINARY_DIR})
endif()

set(BLAKE3_SRC ${blake3_SOURCE_DIR}/c)
set(BLAKE3_INCLUDE_DIR ${blake3_SOURCE_DIR}/c)
target_link_libraries(chiapos PRIVATE blake3)
target_link_libraries(ProofOfSpace PRIVATE blake3)
include_directories(
${INCLUDE_DIRECTORIES}
Expand All @@ -169,7 +170,14 @@ add_executable(RunTests
tests/test.cpp
src/chacha8.c
)
target_link_libraries(RunTests PRIVATE blake3)

target_link_libraries(RunTests
PRIVATE
fse
Threads::Threads
Catch2::Catch2
blake3
)

find_package(Threads REQUIRED)

Expand Down Expand Up @@ -233,5 +241,5 @@ if (${CP_LINK_BLADEBIT_HARVESTER})
endif()


#enable_testing()
#add_test(NAME RunTests COMMAND RunTests)
enable_testing()
add_test(NAME RunTests COMMAND RunTests)

0 comments on commit 63a2824

Please sign in to comment.