From ee7f68a9ea3b4fdba3e9aeb02e639cd93b552bb4 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 30 Oct 2024 11:27:01 -0400 Subject: [PATCH] Add in a library prefix for lz4 from conda on Windows. (#1846) * Add in a library prefix for lz4 from conda on Windows. The comment explains why we need to do this. Signed-off-by: Chris Lalancette --- liblz4_vendor/cmake/Modules/Findlz4.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/liblz4_vendor/cmake/Modules/Findlz4.cmake b/liblz4_vendor/cmake/Modules/Findlz4.cmake index 59dc55d786..d39e9dd33c 100644 --- a/liblz4_vendor/cmake/Modules/Findlz4.cmake +++ b/liblz4_vendor/cmake/Modules/Findlz4.cmake @@ -4,6 +4,13 @@ if(NOT lz4_ROOT_DIR AND DEFINED ENV{lz4_ROOT_DIR}) "lz4 base directory location (optional, used for nonstandard installation paths)") endif() +# When using lz4 from conda on Windows, and cmake before 3.29.0, +# we need to add the library prefix "lib" so that the library can +# be successfully found. +if(MSVC AND CMAKE_VERSION VERSION_LESS "3.29.0") + set(CMAKE_FIND_LIBRARY_PREFIXES "" "lib") +endif() + # Search path for nonstandard package locations if(lz4_ROOT_DIR) set(lz4_INCLUDE_PATH PATHS "${lz4_ROOT_DIR}/include" NO_DEFAULT_PATH)