Skip to content

Commit

Permalink
Enable testing Relic nightly in CI. (Chia-Network#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmineKhaldi authored Oct 18, 2022
1 parent 4405119 commit 873f42e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
30 changes: 20 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ set(SODIUM_DISABLE_TESTS "on" CACHE STRING "")
set(SODIUM_CHIA_MINIMAL "on" CACHE STRING "")
FetchContent_MakeAvailable(Sodium)

if (DEFINED ENV{RELIC_MAIN})
if(DEFINED ENV{RELIC_MAIN})
set(RELIC_GIT_TAG "origin/main")
else ()
set(RELIC_REPOSITORY "https://github.com/relic-toolkit/relic.git")
else()
# This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5
set(RELIC_GIT_TAG "215c69966cb78b255995f0ee9c86bbbb41c3c42b")
endif ()
set(RELIC_REPOSITORY "https://github.com/Chia-Network/relic.git")
endif()

message(STATUS "Relic will be built from: ${RELIC_GIT_TAG}")
message(STATUS "Relic will be built from: ${RELIC_GIT_TAG} and repository ${RELIC_REPOSITORY}")

FetchContent_Declare(
relic
GIT_REPOSITORY https://github.com/Chia-Network/relic.git
GIT_REPOSITORY ${RELIC_REPOSITORY}
GIT_TAG ${RELIC_GIT_TAG}
)

Expand Down Expand Up @@ -107,12 +109,20 @@ else()
set(FP_QNRES "on" CACHE STRING "")
endif()

set(FP_METHD "INTEG;INTEG;INTEG;MONTY;LOWER;SLIDE" CACHE STRING "")

if(MSVC)
set(COMP_FLAGS "" CACHE STRING "")
if(DEFINED ENV{RELIC_MAIN})
set(FP_METHD "INTEG;INTEG;INTEG;MONTY;LOWER;JMPDS;SLIDE" CACHE STRING "")
if(MSVC)
set(CFLAGS "" CACHE STRING "")
else()
set(CFLAGS "-O3 -funroll-loops -fomit-frame-pointer" CACHE STRING "")
endif()
else()
set(COMP_FLAGS "-O3 -funroll-loops -fomit-frame-pointer" CACHE STRING "")
set(FP_METHD "INTEG;INTEG;INTEG;MONTY;LOWER;SLIDE" CACHE STRING "")
if(MSVC)
set(COMP_FLAGS "" CACHE STRING "")
else()
set(COMP_FLAGS "-O3 -funroll-loops -fomit-frame-pointer" CACHE STRING "")
endif()
endif()

set(FP_PMERS "off" CACHE STRING "")
Expand Down
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ if(BUILD_BLS_TESTS)
GIT_TAG v3.0.0-preview5
)
FetchContent_MakeAvailable(Catch2)
find_package(Threads REQUIRED)
add_executable(runtest test.cpp)
target_link_libraries(runtest PRIVATE bls Catch2::Catch2)
target_link_libraries(runtest
PRIVATE
bls
Catch2::Catch2
Threads::Threads
)
endif()

if(BUILD_BLS_BENCHMARKS)
Expand Down

0 comments on commit 873f42e

Please sign in to comment.