Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support BUILD_SHARED_LIBS #104

Merged
merged 2 commits into from
Jan 27, 2025
Merged

Support BUILD_SHARED_LIBS #104

merged 2 commits into from
Jan 27, 2025

Conversation

bretbrownjr
Copy link
Contributor

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
Contributor 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
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
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
57 of 58 checks passed
@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