On Sun, Feb 16, 2020 at 4:48 PM Lasse Collin <lasse.col...@tukaani.org> wrote:
> > - The lib prefix in the target generated by the add_library command > > is not needed as cmake will automatically prepend lib on appropriate > > targets, if you want to force it to always output as `liblzma` you > > could use > > > https://cmake.org/cmake/help/v3.1/variable/CMAKE_STATIC_LIBRARY_PREFIX.html > > or > > > https://cmake.org/cmake/help/v3.0/variable/CMAKE_SHARED_LIBRARY_PREFIX.html > > and set them to "lib" or set the prefix in line 269 instead of blank > > If I use add_library(lzma ...) and PREFIX "lib", isn't the end result > practically identical to the current method? Or is it more about coding > style and "liblzma" looks weird? > This was just more of a coding style since not many people usually care to force a lib prefix on msvc built dlls. In my opinion, I would say that forcing lib prefix is a bit weird, but it might be fine in lzma's case since even CMake uses libLZMA https://cmake.org/cmake/help/latest/module/FindLibLZMA.html > > - I'm not sure if `-Wl,--version-script` is supported on all OSs. > > It's not. configure enables the version script only on GNU/* and > FreeBSD. In CMakeLists.txt I only cared about Windows and GNU/Linux for > now. Even the GNU/Linux side is barely half done as it just assumes > things that are true only if the compiler and glibc are new enough > (e.g. clock_gettime() depends on librt in old glibc versions). > > Is there a need for liblzma-only CMake support outside Windows? > That's an ehh point, personally, if I see a CMakeLists in a project, I would try cmake before trying Autotools since a lot of times, Autotools files are written with linux in mind with not much consideration for other platforms until someone else adds support etc, although the Autotools configuration being broken is rare. I guess one main usage would be in the cases where another project uses CMake and pulls liblzma as a dependency and builds it in situations where a system provided liblzma is not available. It would be easier for those people to just use external_project without a lot of configuration with native CMake support instead of worrying about if bash or sh is available for configure Thanks for your help! > You're welcome