Skip to content

Support BUILD_SHARED_LIBS#104

Merged
bretbrownjr merged 2 commits intomainfrom
support-build-shared-libs
Jan 27, 2025
Merged

Support BUILD_SHARED_LIBS#104
bretbrownjr merged 2 commits intomainfrom
support-build-shared-libs

Conversation

@bretbrownjr
Copy link
Copy Markdown
Member

Problem

Hardcoding STATIC is unneeded and breaks support for the standard CMake feature BUILD_SHARED_LIBS.

Solution

Remove STATIC from the add_library(exemplar) statement and allow CMake defaults to provide a default static library build.

Reference

For add_library supporting BUILD_SHARED_LIBS:
https://cmake.org/cmake/help/latest/command/add_library.html

Docs for BUILD_SHARED_LIBS, including that STATIC is the default for CMake built libraries.
https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html#variable:BUILD_SHARED_LIBS

## Problem

Hardcoding STATIC is unneeded and breaks support for the
standard CMake feature `BUILD_SHARED_LIBS`.

## Solution

Remove `STATIC` from the `add_library(exemplar)` statement
and allow CMake defaults to provide a default static library
build.

## Reference

For `add_library` supporting `BUILD_SHARED_LIBS`:
 https://cmake.org/cmake/help/latest/command/add_library.html

Docs for `BUILD_SHARED_LIBS`, including that `STATIC` is
the default for CMake built libraries.
 https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html#variable:BUILD_SHARED_LIBS
@bretbrownjr
Copy link
Copy Markdown
Member Author

Hardcoding STATIC in add_library commands is a way to explicitly remove support for shared library builds, though I don't believe we forbid or even discourage shared library linking in the Beman Standard at this point. Presumably some libraries would like to support this feature, especially because standard C++ library implementations do release as shared libraries.

Copy link
Copy Markdown
Member

@wusatosi wusatosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a very reasonable update for me.

Copy link
Copy Markdown
Member

@neatudarius neatudarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Please open an issue here https://github.com/bemanproject/beman/issues. We need to update the Beman Standard and all repos.

@bretbrownjr bretbrownjr merged commit 7394fcf into main Jan 27, 2025
@bretbrownjr bretbrownjr deleted the support-build-shared-libs branch January 27, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants