Skip to content

Turn libfmt-c into shared#4812

Merged
vitaut merged 1 commit into
fmtlib:mainfrom
jengelh:master
Jun 26, 2026
Merged

Turn libfmt-c into shared#4812
vitaut merged 1 commit into
fmtlib:mainfrom
jengelh:master

Conversation

@jengelh

@jengelh jengelh commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Linux distros don't like having static archives. Set fmt-c to shared just like fmt.

@jengelh jengelh requested a review from vitaut as a code owner June 16, 2026 14:06
Comment thread include/fmt/fmt-c.h Outdated
Comment thread include/fmt/fmt-c.h Outdated

@vitaut vitaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please don't add new headers.

@vitaut vitaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's OK to have a separate macro for now, but let's rename it from CFMT_API to FMT_CAPI to avoid reserving a new prefix. And similarly for visibitlity.

Comment thread include/fmt/fmt-c.h Outdated
@jengelh jengelh force-pushed the master branch 2 times, most recently from fb105dc to da0bacb Compare June 23, 2026 09:42
@tom--pollard

Copy link
Copy Markdown

We're looking to distribute 12.2.0 in the freedesktop-sdk project and also agree that we would prefer not to include the static lib:

https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/merge_requests/32873

github-actions Bot pushed a commit to castrojo/freedesktop-sdk that referenced this pull request Jun 24, 2026
Updates elements/components/fmtlib.bst to 12.2.0-0 (1be298e)
Previous version was 12.1.0-0 (407c905)

Fix for i686 32bit compilation landed after release:

fmtlib/fmt@588b3a0f8f6a8bcf2a959cae882d5
b2703e86737

Static libfmt-c archive introduced via:

fmtlib/fmt@dc97113ca160beea3ac33a781bac5
2829456ff60

Subsequently patched to be shared after the release via:

fmtlib/fmt#4812

@vitaut vitaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are some CI failures.

Comment thread include/fmt/fmt-c.h Outdated
Comment thread include/fmt/fmt-c.h Outdated
@jengelh

jengelh commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

There are some CI failures.

LINK : fatal error LNK1104: cannot open file '..\Debug\fmt-cd.lib' [D:\a\fmt\build\test\c-test.vcxproj]

I do not know how to fix this. On a whim I had previously tried switching PRIVATE fmt::fmt-c in tests/CMakeLists.txt for PUBLIC, but that error stayed. (so the change is backed out again)

Linux distros don't like having static archives. Set fmt-c to shared
just like the main fmt library.
@vitaut vitaut merged commit 719823c into fmtlib:main Jun 26, 2026
46 checks passed
@tom--pollard

Copy link
Copy Markdown

Thanks for this!

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