[cmake-developers] Shared libraries
chuck.atkins at kitware.com
Tue Aug 21 12:02:44 EDT 2018
I expect what your seeing is likely the result of how MaraiaDBhas
specifically implemented their CMake build. The only builtin CMake
variable to control this is BUILD_SHARED_LIBS, which when set to "ON"
changes the behavior of add_library(foo) to be add_library(foo SHARED),
instead of the default add_library(foo STATIC). The other
BUILD_STATIC_LIBS and DISABLE_SHARED are variables are not builtin to CMake
and are part of however they have chosen to implement their build.
CMake builds are typically designed to produce a single configuration, i.e.
shared release or static debug, etc. Often, however, because to have the
flexibility to do otherwise. projects will try to instead implement a build
that produces several configurations in a single pass. It seems this is
what MariaDB has done and as such the variables to control it will be
unique and specific to that project and how they've decided to implement it.
Staff R&D Engineer, Scientific Computing
On Thu, Aug 9, 2018 at 12:23 PM REIX, Tony <tony.reix at atos.net> wrote:
> 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.
> I've tried to use:
> -DBUILD_SHARED_LIBS=ON \
> -DBUILD_STATIC_LIBS=OFF \
> -DCMAKE_C_CREATE_SHARED_LIBRARY=ON \
> and I see that, for MariaDB, someone has tried with:
> None seems to work.
> Which CMake variable should I use for asking CMAKE to generate shared
> libraries rather than static ones: lib*.a file containing .so files rather
> than .o files.
> Tony Reix
> tony.reix at atos.net
> ATOS / Bull SAS
> ATOS Expert
> IBM Coop Architect & Technical Leader
> Office : +33 (0) 4 76 29 72 67
> 1 rue de Provence - 38432 Échirolles - France
> Powered by www.kitware.com
> Please keep messages on-topic and check the CMake FAQ at:
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> Visit other Kitware open-source projects at
> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cmake-developers