jedisct1 / libsodium

A modern, portable, easy to use crypto library.
https://libsodium.org
Other
12.06k stars 1.72k forks source link

build: do not define the sodium target when not found by CMake #1287

Closed aminya closed 1 year ago

aminya commented 1 year ago

As specified in the docs, sodium_FOUND is set when all the required vars are found. Previously the code defined an incorrect sodium target even though the needed variables were not found. This prevents subsequent searches by other methods. This PR fixes the issue by an early return.

https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html

jedisct1 commented 1 year ago

Thanks!