Skip to content

Commit

Permalink
Fix implicitly converting 'INTEGER' to 'STRING' type warnings. (Chia-…
Browse files Browse the repository at this point in the history
  • Loading branch information
AmineKhaldi authored Aug 4, 2021
1 parent 83b370e commit ecf77cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
25 changes: 13 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ endif()

project(BLS)

set(BUILD_BLS_PYTHON_BINDINGS 1 CACHE INTEGER "")
set(BUILD_BLS_TESTS 1 CACHE INTEGER "")
set(BUILD_BLS_BENCHMARKS 1 CACHE INTEGER "")
set(BUILD_BLS_PYTHON_BINDINGS "1" CACHE STRING "")
set(BUILD_BLS_TESTS "1" CACHE STRING "")
set(BUILD_BLS_BENCHMARKS "1" CACHE STRING "")

message(STATUS "Build python bindings: ${BUILD_BLS_PYTHON_BINDINGS}")
message(STATUS "Build tests: ${BUILD_BLS_TESTS}")
Expand Down Expand Up @@ -52,16 +52,16 @@ else()
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(WSIZE 32 CACHE INTEGER "")
set(WSIZE "32" CACHE STRING "Relic - Processor word size")
else()
set(WSIZE 64 CACHE INTEGER "")
set(WSIZE "64" CACHE STRING "Relic - Processor word size")
endif()

if(EMSCRIPTEN)
# emscripten needs arch set to be none since it can't compile assembly
set(ARCH "" CACHE STRING "")
# emscripten is a 32 bit compiler
set(WSIZE 32 CACHE INTEGER "")
set(WSIZE "32" CACHE STRING "Relic - Processor word size")
endif()

set(TIMER "CYCLE" CACHE STRING "")
Expand All @@ -72,7 +72,7 @@ set(SHLIB "OFF" CACHE STRING "")
set(MULTI "PTHREAD" CACHE STRING "")
set(DOCUM "off" CACHE STRING "")

set(FP_PRIME 381 CACHE INTEGER "")
set(FP_PRIME "381" CACHE STRING "Relic - Prime modulus size")

IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SEED "UDEV" CACHE STRING "")
Expand All @@ -97,21 +97,22 @@ set(FPX_METHD "INTEG;INTEG;LAZYR" CACHE STRING "")
set(EP_PLAIN "off" CACHE STRING "")
set(EP_SUPER "off" CACHE STRING "")
# Disable relic tests and benchmarks
set(TESTS 0 CACHE INTEGER "")
set(BENCH 0 CACHE INTEGER "")
set(QUIET 1 CACHE INTEGER "")
set(TESTS "0" CACHE STRING "Relic - Number of times each test is ran")
set(BENCH "0" CACHE STRING "Relic - Number of times each benchmark is ran")

set(QUIET "on" CACHE STRING "Relic - Build with printing disabled")

set(PP_EXT "LAZYR" CACHE STRING "")
set(PP_METHD "LAZYR;OATEP" CACHE STRING "")

add_subdirectory(src)

if (EMSCRIPTEN)
if(EMSCRIPTEN)
add_subdirectory(js-bindings)
else()
# emscripten can't build python bindings, it produces only javascript
# add_subdirectory(contrib/pybind11)
if (BUILD_BLS_PYTHON_BINDINGS)
if(BUILD_BLS_PYTHON_BINDINGS)
add_subdirectory(python-bindings)
endif()
endif()
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@ install(DIRECTORY ${relic_BINARY_DIR}/include/ DESTINATION include/chiabls)
install(FILES ${includes} DESTINATION include/chiabls)
install(FILES ${C_LIB} DESTINATION lib)

if (BUILD_BLS_TESTS)
if(BUILD_BLS_TESTS)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/catch)
add_executable(runtest test.cpp)
if (SODIUM_FOUND)
if(SODIUM_FOUND)
target_link_libraries(runtest blstmp relic_s sodium)
else()
target_link_libraries(runtest blstmp relic_s)
endif()
endif()

if (BUILD_BLS_BENCHMARKS)
if(BUILD_BLS_BENCHMARKS)
add_executable(runbench test-bench.cpp)
if (SODIUM_FOUND)
if(SODIUM_FOUND)
target_link_libraries(runbench blstmp relic_s sodium)
else()
target_link_libraries(runbench blstmp relic_s)
Expand Down

0 comments on commit ecf77cc

Please sign in to comment.