Skip to content

Commit

Permalink
use upgraded libsodium 1.0.20; use compiled static libsodium for Wind…
Browse files Browse the repository at this point in the history
…ows instead of precompiled;
  • Loading branch information
neodiX committed Jun 9, 2024
1 parent e52890d commit 23ea7b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
16 changes: 9 additions & 7 deletions CMake/FindSodium.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ if (NOT DEFINED SODIUM_USE_STATIC_LIBS)
option(SODIUM_USE_STATIC_LIBS "enable to statically link against sodium" OFF)
endif()
if(NOT (SODIUM_USE_STATIC_LIBS EQUAL SODIUM_USE_STATIC_LIBS_LAST))
unset(sodium_LIBRARY CACHE)
unset(SODIUM_LIBRARY_DEBUG CACHE)
unset(SODIUM_LIBRARY_RELEASE CACHE)
unset(sodium_DLL_DEBUG CACHE)
unset(sodium_DLL_RELEASE CACHE)
set(SODIUM_USE_STATIC_LIBS_LAST ${SODIUM_USE_STATIC_LIBS} CACHE INTERNAL "internal change tracking variable")
if (NOT SODIUM_LIBRARY_RELEASE)
unset(sodium_LIBRARY CACHE)
unset(SODIUM_LIBRARY_DEBUG CACHE)
unset(SODIUM_LIBRARY_RELEASE CACHE)
unset(sodium_DLL_DEBUG CACHE)
unset(sodium_DLL_RELEASE CACHE)
set(SODIUM_USE_STATIC_LIBS_LAST ${SODIUM_USE_STATIC_LIBS} CACHE INTERNAL "internal change tracking variable")
endif()
endif()


Expand Down Expand Up @@ -295,4 +297,4 @@ else()
)
endif()
endif()
endif()
endif()
7 changes: 6 additions & 1 deletion assembly/native/build-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ echo Using secp256k1...

if not exist "libsodium" (
git clone https://github.com/jedisct1/libsodium.git
git checkout 1.0.20-RELEASE
cd libsodium\builds\msvc\vs2022\libsodium
msbuild libsodium.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v143
msbuild libsodium.vcxproj /p:Configuration=ReleaseLIB /p:platform=x64 -p:PlatformToolset=v143
dir /s
IF %errorlevel% NEQ 0 (
echo Can't download libsodium
Expand Down Expand Up @@ -135,6 +136,10 @@ cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
-DPORTABLE=1 ^
-DSODIUM_USE_STATIC_LIBS=1 ^
-DSODIUM_FOUND=1 ^
-DSODIUM_LIBRARY_RELEASE=%root%\libsodium\bin\x64\Release\v143\static\libsodium.lib ^
-DSODIUM_LIBRARY_DEBUG=%root%\libsodium\bin\x64\Release\v143\static\libsodium.lib ^
-DSODIUM_INCLUDE_DIR=%root%\libsodium\src\libsodium\include ^
-DSECP256K1_FOUND=1 ^
-DSECP256K1_INCLUDE_DIR=%root%\secp256k1\include ^
-DSECP256K1_LIBRARY=%root%\secp256k1\build\src\Release\libsecp256k1.lib ^
Expand Down

0 comments on commit 23ea7b5

Please sign in to comment.