You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Findsodium.cmake without defining sodium_USE_STATIC_LIBS on Windows. It will look for shared libsodium libraries first and if not found, it will fallback to looking for static ones. This behaviour would be consistent with the one on Linux, as on Linux Findsodium.cmake would check pkg-config, which would tell it to -lsodium, and the compiler would link to whatever sodium is available, by default trying shared first and then static.
Observed:
Findsodium.cmake looks for libraries based on library filename, which is fine, but it will look either only for .dll or only for .a/.lib depending on what sodium_USE_STATIC_LIBS is set to, which is not fine. It looks either for shared libraries or for static. It has no mechanism of falling back. On Linux it would fallback searching for static libraries if shared weren't found, but not on Windows. If you try to be smart and try to make it fallback like that:
the second find_package(sodium) will always fail because it tries to create a sodium target, but it already exists, the first call to find_package(sodium) creates it unconditionally, no matter if it does or doesn't find the library:
-- Could NOT find sodium (missing: sodium_LIBRARY_RELEASE sodium_LIBRARY_DEBUG)
-- Found sodium: /root/prefix/i686/lib/libsodium.a
CMake Error at cmake/Findsodium.cmake:251 (add_library):
add_library cannot create imported target "sodium" because another target
with the same name already exists.
Call Stack (most recent call first):
cmake/Dependencies.cmake:31 (find_package)
CMakeLists.txt:123 (include)
The text was updated successfully, but these errors were encountered:
I got the latest code libsodium-1.0.16-mingw.tar.gz but still can't use sodium for a project.
I'm getting the same issue as above: Could NOT find sodium (missing: sodium_LIBRARY_RELEASE sodium_LIBRARY_DEBUG) CMake Error at CMakeLists.txt:9 (MESSAGE): libsodium is required
What can I do to fix it?
To which files should sodium_LIBRARY_RELEASE & sodium_LIBRARY_DEBUG point to?
Expected:
I use Findsodium.cmake without defining
sodium_USE_STATIC_LIBS
on Windows. It will look for shared libsodium libraries first and if not found, it will fallback to looking for static ones. This behaviour would be consistent with the one on Linux, as on Linux Findsodium.cmake would check pkg-config, which would tell it to-lsodium
, and the compiler would link to whatever sodium is available, by default trying shared first and then static.Observed:
Findsodium.cmake looks for libraries based on library filename, which is fine, but it will look either only for
.dll
or only for.a
/.lib
depending on whatsodium_USE_STATIC_LIBS
is set to, which is not fine. It looks either for shared libraries or for static. It has no mechanism of falling back. On Linux it would fallback searching for static libraries if shared weren't found, but not on Windows. If you try to be smart and try to make it fallback like that:the second
find_package(sodium)
will always fail because it tries to create asodium
target, but it already exists, the first call tofind_package(sodium)
creates it unconditionally, no matter if it does or doesn't find the library:The text was updated successfully, but these errors were encountered: