build: fix compilation error of external projects with fmt#431
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
|
There was a problem hiding this comment.
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.
| "glfw3webgpu v1.3.0-alpha", | ||
| { debug = is_mode("debug") } | ||
| ) | ||
| add_requires("fmt 12.1.0", { configs = { header_only = true }, debug = is_mode("debug") }) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's read the xmake.lua file to understand the current state
cat -n xmake.luaRepository: 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 testsRepository: 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 -100Repository: 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.



Related to no issues.
Title is explicit enough
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.