Skip to content

build: fix compilation error of external projects with fmt#431

Merged
Miou-zora merged 1 commit into
mainfrom
fmt-compil-hotfix
Jan 23, 2026
Merged

build: fix compilation error of external projects with fmt#431
Miou-zora merged 1 commit into
mainfrom
fmt-compil-hotfix

Conversation

@ripel2
Copy link
Copy Markdown
Contributor

@ripel2 ripel2 commented Jan 23, 2026

Related to no issues.

Title is explicit enough

Summary by CodeRabbit

  • Chores
    • Adjusted build configuration for debug mode dependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

@ripel2 ripel2 self-assigned this Jan 23, 2026
@ripel2 ripel2 requested a review from a team January 23, 2026 20:06
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

The xmake.lua build configuration was modified to relocate the fmt 12.1.0 dependency from the global requirements list to a debug-specific, header-only dependency configuration.

Changes

Cohort / File(s) Summary
Build Configuration
xmake.lua
Reorganized fmt 12.1.0 dependency: removed from global add_requires and re-added as a debug-mode-only, header-only variant. Affects debug build configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A little tweak to build config bright,
fmt now shines in debug's light,
Header-only, lean and clean,
The smartest dependency I've seen! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fixing a compilation error for external projects with fmt library by modifying its dependency configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@Miou-zora Miou-zora enabled auto-merge (squash) January 23, 2026 20:06
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@xmake.lua`:
- Line 22: The fmt dependency is currently marked debug-only in the add_requires
call (add_requires("fmt 12.1.0", { configs = { header_only = true }, debug =
is_mode("debug") })), which will break release builds; remove the debug =
is_mode("debug") flag so fmt is required unconditionally, or alternatively
ensure every add_packages("fmt") invocation is guarded to match that debug-only
requirement—prefer removing the debug flag so fmt is available for both debug
and release builds.

Comment thread xmake.lua
"glfw3webgpu v1.3.0-alpha",
{ debug = is_mode("debug") }
)
add_requires("fmt 12.1.0", { configs = { header_only = true }, debug = is_mode("debug") })
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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's read the xmake.lua file to understand the current state
cat -n xmake.lua

Repository: EngineSquared/EngineSquared

Length of output: 4397


🏁 Script executed:

# Now let's search for fmt usage in the C++ source code to understand if it's debug-only
rg -n --type=cpp -C2 '\b(fmt::|#include\s*<fmt/)' src tests

Repository: EngineSquared/EngineSquared

Length of output: 50446


🏁 Script executed:

# Also check for any DEBUG or ES_DEBUG guards around fmt usage
rg -n --type=cpp -B3 -A3 'fmt::' src tests | head -100

Repository: EngineSquared/EngineSquared

Length of output: 7280


Remove the debug-only constraint from fmt — it's required in release builds.

fmt is used extensively in production code (logging, formatting) without any DEBUG guards. Making it debug-only via debug = is_mode("debug") on line 22 will break release builds because add_packages("fmt") expects fmt to be required unconditionally. Either remove the debug = is_mode("debug") flag entirely, or conditionally call add_packages("fmt") in all build targets to match the requirement state.

🤖 Prompt for AI Agents
In `@xmake.lua` at line 22, The fmt dependency is currently marked debug-only in
the add_requires call (add_requires("fmt 12.1.0", { configs = { header_only =
true }, debug = is_mode("debug") })), which will break release builds; remove
the debug = is_mode("debug") flag so fmt is required unconditionally, or
alternatively ensure every add_packages("fmt") invocation is guarded to match
that debug-only requirement—prefer removing the debug flag so fmt is available
for both debug and release builds.

@Miou-zora Miou-zora merged commit 0ae173a into main Jan 23, 2026
18 checks passed
@Miou-zora Miou-zora deleted the fmt-compil-hotfix branch January 23, 2026 20:20
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.

2 participants