Skip to content

Commit

Permalink
Only static dependencies (gmp, libsodium) (Chia-Network#86)
Browse files Browse the repository at this point in the history
* Only include libsodium and gmp static libs
  • Loading branch information
mariano54 authored Dec 10, 2019
1 parent 961153f commit dbec82f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules
)

set(sodium_USE_STATIC_LIBS TRUE)
find_package(sodium)
if (SODIUM_FOUND)
message(STATUS "Found libsodium")
Expand All @@ -22,6 +23,7 @@ if (SODIUM_FOUND)
include_directories(${sodium_INCLUDE_DIR})
endif()

set(STBIN TRUE)
find_package(gmp)
if (GMP_FOUND)
message(STATUS "Found libgmp")
Expand Down
2 changes: 1 addition & 1 deletion cmake_modules/Findgmp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES)

find_path(GMP_INCLUDE_DIR NAMES gmp.h)
if(STBIN)
find_library(GMP_LIBRARIES NAMES libgmp.a gmp)
find_library(GMP_LIBRARIES NAMES libgmp.a)
else(STBIN)
find_library(GMP_LIBRARIES NAMES libgmp.so gmp)
endif(STBIN)
Expand Down
10 changes: 9 additions & 1 deletion cmake_modules/Findsodium.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ if (UNIX)
list(INSERT sodium_PKG_STATIC_LIBRARIES 0 "lib${_libname}.a")
endif()
endforeach()
list(REMOVE_DUPLICATES sodium_PKG_STATIC_LIBRARIES)

# If the list is empty, don't remove duplicates
if (sodium_PKG_STATIC_LIBRARIES)
list(REMOVE_DUPLICATES sodium_PKG_STATIC_LIBRARIES)

# Remove "sodium" which can pull in dynamic lib
list(REMOVE_ITEM sodium_PKG_STATIC_LIBRARIES "sodium")
endif()


# if pkgconfig for libsodium doesn't provide
# static lib info, then override PKG_STATIC here..
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def build_extension(self, ext):

setup(
name='blspy',
version='0.1.12',
version='0.1.13',
author='Mariano Sorgente',
author_email='[email protected]',
description='BLS signatures in c++ (python bindings)',
Expand Down

0 comments on commit dbec82f

Please sign in to comment.