[cmake-developers] Shared libraries

APEKE, SENA (ext) sena.apeke.external at atos.net
Wed Aug 22 10:04:23 EDT 2018


Hi Chuck,

I also followed the discussions, we thank you for your answers and we shall come back to you if needed.

Regards,
Séna

From: Chuck Atkins [mailto:chuck.atkins at kitware.com]
Sent: Tuesday, August 21, 2018 6:58 PM
To: REIX, Tony <tony.reix at atos.net>
Cc: CMake Developers <cmake-developers at cmake.org>; APEKE, SENA (ext) <sena.apeke.external at atos.net>
Subject: Re: [cmake-developers] Shared libraries

Hi Tony,

I believe I somewhat misunderstood what appears to be two separate issues here: 1: how to get your build to generate the static and shared libraries and 2: the library format doesn't seem correct. Regarding 1, it will be project specific if the project's build designed to simultaneously produce multiple configurations. In the context of MongoC, I've looked at the CMake files and it seems as though shared libraries are always built and static libraries can *also* be explicitly enabled/disabled by setting -DENABLE_STATIC=ON or -DENABLE_STATIC=OFF.

Regarding 2,


On AIX, when building MongoC 1.11, cmake 3.11.4 generates lib*.so files and lib*.a files which contain .o files.

On AIX, we should get libraries lib*.a containing the lib*.so file.

While with most SysV and BSD unices the concept of "shared libraries" and "runtime linking" are one in the same and go togethor, on AIX they are two seperate ideas orthogonal to one another.  On AIX you can have shared libraries used for runtime-linking, i.e. libfoo.so containing objects, and archive files libfoo.a used for compile time linking.  The archive file can then in turn contain object files used for static linkling or an so used for shared linking.  CMake will produce the stand alone libfoo.so shared lib for shared runtime linking and the libfoo.a archive with object files for static compile-time linking, but I believe does not support generating the libfoo.a archive with .sos for shared compile-time linking.

- Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20180822/3871e52b/attachment.html>


More information about the cmake-developers mailing list