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

Boost_USE_STATIC_LIBS deviates from FindBoost.cmake behaviour #66

Open
jpfeuffer opened this issue Sep 1, 2023 · 5 comments
Open

Boost_USE_STATIC_LIBS deviates from FindBoost.cmake behaviour #66

jpfeuffer opened this issue Sep 1, 2023 · 5 comments

Comments

@jpfeuffer
Copy link

jpfeuffer commented Sep 1, 2023

In the Find module, Boost_USE_STATIC_LIBS=OFF means that it is allowed to find either a dynamic version of boost or a static version.

With your config file, Boost_USE_STATIC_LIBS=OFF forces shared-only.

a) Why the deviation? This makes consistent CMake scripts very difficult if one wants to support older boosts without the config.
b) Why those arbitrary choices for the value OFF? Shouldn't the consumer decide?! How would one even choose shared/dynamic boost on Windows with this? Edit: corrected

While this is considered, can you recommend a quick fix on how to use this config to find either shared or static? After all, many builds are agnostic to how boost was linked.

@jpfeuffer
Copy link
Author

jpfeuffer commented Sep 1, 2023

Sorry, I just saw that I confused OFF with not set, or overlooked the "third option" of not setting the variable. Let me reevaluate.

@jpfeuffer
Copy link
Author

Ok so ignore point b) but the rest of the issue still stands:

  • Why deviate from the FindModule for the same variable?
  • How to look for both, either shared or static? (Without triggering two searches where one will unnecessarily clutter the CMake configuration logs.)

@jpfeuffer
Copy link
Author

jpfeuffer commented Sep 1, 2023

IMHO the behaviour should be at least:

(changes in bold)

Boost_USE_STATIC_LIBS: When ON, uses static Boost libraries; when OFF,
uses shared Boost libraries; when not set, PREFERS
static on Windows, shared otherwise but accepts both.

Or just follow the behaviour from the FindModule.

@pdimov
Copy link
Member

pdimov commented Sep 1, 2023

Our generated config files don't have the ability to accept both static and shared. It needs to be chosen beforehand. That's why we don't match the FindBoost behavior.

@jpfeuffer
Copy link
Author

I see. Is this a general limitation of how boost is designed or was it "just not implemented yet"? If it's a limitation, can you very shortly elaborate on the problem?

In general I think CMake config files can support that.

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

No branches or pull requests

2 participants