1
Feature requests / (CMake) Make BUILD_SHARED_LIBS=OFF by default
« on: April 14, 2021, 12:16:18 am »
I propose to not set BUILD_SHARED_LIBS to "OFF" by default (except for platforms where static linking is not supported).
Some projects using CMake are building shared libraries which can be convenient for some people, but doesn't really follow what "BUILD_SHARED_LIBS" is meant to do.
See the docs: https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
This makes "BUILD_SHARED_LIBS" opt-in flag. But currently I need to "opt-out" from building shared libraries, which is not convenient, as I expect that static libs are built by default, which is the convention that a lot of CMake projects follow.
Some projects using CMake are building shared libraries which can be convenient for some people, but doesn't really follow what "BUILD_SHARED_LIBS" is meant to do.
See the docs: https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
Quote
If present and true, this will cause all libraries to be built shared unless the library was explicitly added as a static library.
This makes "BUILD_SHARED_LIBS" opt-in flag. But currently I need to "opt-out" from building shared libraries, which is not convenient, as I expect that static libs are built by default, which is the convention that a lot of CMake projects follow.