Following the reproduce steps:
vcpkg install lz4:x64-windows
cd <wiredtiger-11.0.0> mkdir build cd build cmake -DCMAKE_TOOLCHAIN_FILE=<vcpkg_root>/scripts/buildsystems/vcpkg.cmake -DHAVE_BUILTIN_EXTENSION_LZ4=1 -DENABLE_STATIC=1 -DENABLE_PYTHON=0 ..
I got:
CMake Warning (dev) in CMakeLists.txt: Policy CMP0111 is not set: An imported target missing its location property fails during generation. Run "cmake --help-policy CMP0111" for policy details. Use the cmake_policy command to set the policy and suppress this warning. IMPORTED_IMPLIB not set for imported target "wt::lz4" configuration "Release".
then continue with:
msbuild ALL_BUILD.vcxproj
got:
LINK : fatal error LNK1104: cannot open file"wt::lz4-NOTFOUND.obj"
I check the add_library, it said:
- For a SHARED library on Windows, the IMPORTED_IMPLIB target property (or its per-configuration variant IMPORTED_IMPLIB_<CONFIG>) specifies the location of the DLL import library file (.lib or .dll.a) on disk, and the IMPORTED_LOCATION is the location of the .dll runtime library (and is optional, but needed by the TARGET_RUNTIME_DLLS generator expression).
So I modified cmake/third_party/lz4.cmake:
--- a/cmake/third_party/lz4.cmake
+++ b/cmake/third_party/lz4.cmake@@ -13,7 +13,7 @@ endif()
# with an IMPORTED target (which allows CMake to issue a diagnostic message if the library wasn't found).
add_library(wt::lz4 SHARED IMPORTED GLOBAL)
set_target_properties(wt::lz4 PROPERTIES
- IMPORTED_LOCATION ${HAVE_LIBLZ4}
+ IMPORTED_IMPLIB ${HAVE_LIBLZ4}
)
And the build succeeded.
The same for other builtin compressors: snappy, zstd, zlib.
I made a vcpkg port of wiredtiger including two patches to solve the building problems on windows, I don't know if this makes sense:
- related to
-
WT-10694 Compile third party lib on Windows
- Open