Skip to content

fix: [build]Fix build issue without format support - #9065

Merged
sithlord48 merged 1 commit into
deskflow:masterfrom
re2zero:fix
Oct 24, 2025
Merged

fix: [build]Fix build issue without format support#9065
sithlord48 merged 1 commit into
deskflow:masterfrom
re2zero:fix

Conversation

@re2zero

@re2zero re2zero commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

fixes: #9064

add C++20 support checks in Unix libraries and update logging format usage.

Log: Fix build issue without format support.

@re2zero

re2zero commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

Fix build issue #9064, the format checking output:

-- Performing Test HAS_FORMAT
-- Performing Test HAS_FORMAT - Failed
-- C++ <format> library support: NO

Comment thread cmake/Libraries.cmake Outdated

@sithlord48 sithlord48 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With all of these having an alt path do we even really need to use format at this point ?

@re2zero

re2zero commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

With all of these having an alt path do we even really need to use format at this point ?

I guess it is mainly used for Log, such as using fmt in spdlog to format the log and get better performance.

@nbolton

nbolton commented Oct 21, 2025

Copy link
Copy Markdown
Member

In principle, I think this is a good patch and I wonder how it fits long-term with our Qt strategy.

do we even really need to use format

Are you thinking we may be better off switching to Qt equivalent to remove the #ifdef altogether?

IIRC, <format> support was pretty patchy at one point but I haven't look at it in the last year or so.

@sithlord48

Copy link
Copy Markdown
Member

If we want to move to #8483 using Qt then we don't need format do we ? even with out if we have a fallback do we really require fmt or was it just easier for who ever wrote it at that time.

@nbolton

nbolton commented Oct 21, 2025

Copy link
Copy Markdown
Member

do we really require fmt or was it just easier for who ever wrote it at that time.

IIRC, I was trying to modernise the part of the code that used snprintf... I think SonarCloud was grumbling about using it for dates but my memory is foggy. In hindsight, adding a new code path there didn't really help since wasn't available on macOS at the time (and apparently still isn't on some Linux distros?)

Anyway, switching to however Qt does it seems sane; std C++ is a bit of a nightmare for consistency across platforms, which is something Qt does really well.

@sithlord48

Copy link
Copy Markdown
Member

should try format on mac os and see if it works now

Comment thread src/lib/base/Log.cpp Outdated
add C++20 <format> support checks in Unix libraries and update logging format usage.

Log: Fix build issue without format support.
@sithlord48
sithlord48 merged commit 8226c41 into deskflow:master Oct 24, 2025
28 checks passed
@re2zero
re2zero deleted the fix branch October 27, 2025 01:15
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.

Build failed if without format support

3 participants