On 2022-08-18 Olivier B. wrote:
> The cmake windows build in a 5.2.6 git clone seem to build and install
> fine for me!

Good to know, thanks!

> As small an improvement to them, I wouldn't mind if the pdbs were
> installed too in the configurations where they are generated (and
> actually also in release builds)

I see .pdb files are for debug symbols and I see CMake has some
properties related to them but I don't know much more. Are the .pdb
files generated by default in the CMake-generated debug targets but not
by the release targets? Does the following do something good?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a88af3..ccfb217 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -499,6 +499,14 @@ install(DIRECTORY src/liblzma/api/
         DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
         FILES_MATCHING PATTERN "*.h")
 
+if(MSVC)
+    # Install MSVC debug symbol file if it was generated.
+    install(FILES $<TARGET_PDB_FILE:liblzma>
+            DESTINATION "${CMAKE_INSTALL_BINDIR}"
+            COMPONENT liblzma_Development
+            OPTIONAL)
+endif()
+
 # Install the CMake files that other packages can use to find liblzma.
 set(liblzma_INSTALL_CMAKEDIR
     "${CMAKE_INSTALL_LIBDIR}/cmake/liblzma"

I understood that the above can only work for DLLs. Static library
would need compiler-generated debug info which CMake supports via
COMPILE_PDB_NAME property. If .pdb files aren't created for release
builds by default, there likely is a way to enable it. I cannot test
MSVC builds now so I won't make many blind guesses.

-- 
Lasse Collin

Reply via email to