Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
AmineKhaldi committed Apr 18, 2023
1 parent 5f4986c commit 6ab0209
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ if("$ENV{CFLAGS}" STREQUAL "")
endif()
else()
if (MSVC)
set(COMP_FLAGS "/O2" CACHE STRING "Default compiler flags.")
set(COMP_FLAGS "/MP /O2" CACHE STRING "Default compiler flags.")
else()
set(COMP_FLAGS "-pipe -std=c99 -O2 -funroll-loops -fomit-frame-pointer" CACHE STRING "Default compiler flags.")
endif()
Expand Down Expand Up @@ -282,7 +282,8 @@ else()
set(PFLAGS "")
endif()

if(ARITH STREQUAL "gmp" OR ARITH STREQUAL "gmp-sec")
# We'll be using our custom MPIR build instead of GMP for MSVC builds
if((ARITH STREQUAL "gmp" OR ARITH STREQUAL "gmp-sec") AND (NOT MSVC))
include(cmake/gmp.cmake)
if(GMP_FOUND)
include_directories(${GMP_INCLUDE_DIR})
Expand Down
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,13 @@ if (STLIB)
add_library(${RELIC_S} STATIC ${RELIC_SRCS} ${ARITH_OBJS})
endif(AMALG)
add_dependencies(${RELIC_S} arith_objs)
target_link_libraries(${RELIC_S} ${ARITH_LIBS})
if(MSVC)
message(STATUS "Configured with MPIR (GMP fork)")
target_include_directories(${RELIC_S} PUBLIC ${MPIR_INCLUDE_DIR})
target_link_libraries(${RELIC_S} PRIVATE ${MPIR_IMPLIB})
else()
target_link_libraries(${RELIC_S} ${ARITH_LIBS})
endif()
link_libs(${RELIC_S})
install(TARGETS ${RELIC_S} ARCHIVE DESTINATION lib)
endif(STLIB)

0 comments on commit 6ab0209

Please sign in to comment.