)
```
> XMake's smaller API surface = **fewer ways to be wrong** ๐ฏ
---
### Dimension 3: Error Diagnosis ๐ฌ
When a build fails, I must trace through the build config:
.mermaid[
graph TD
subgraph CMakeDebug["CMake Debug"]
CD1["Error in\nCMakeLists.txt"] --> CD2["Include chain:\ncmake/CPM.cmake\nspecific.cmake\ncmake/tools.cmake"]
CD2 --> CD3["Trace through\nmodule path\nFind the source"]
end
subgraph XMakeDebug["XMake Debug"]
XD1["Error in\nxmake.lua"] --> XD2["Single file\nLinear flow\nOne place to look"]
end
style CMakeDebug fill:#fce4ec,stroke:#f44336
style XMakeDebug fill:#e8f5e9,stroke:#4caf50
style CD1 fill:#f44336
style CD2 fill:#ff9800
style CD3 fill:#ff9800
style XD1 fill:#4caf50
style XD2 fill:#4caf50
]
> **CMake debugging = archaeological dig.** XMake debugging = read the file. ๐
---
### Dimension 4: Agentic Coding Success Rate ๐
The most important metric for AI-assisted development:
.pull-left[
.font-sm[
| Step | CMake ๐ต | XMake ๐ข |
|------|:--------:|:--------:|
| **Read & understand** | 4 files, 320 lines, non-linear includes | 1 file, 144 lines, linear |
| **Modify correctly** | Must know which file, CPM conventions, generator expressions | Edit one file, Lua is obvious |
| **Verify** | 2 commands, cd into build dir | 1 command |
| **Failure recovery** | Trace through cmake module chain | Read error, fix the line |
| **Est. success rate** | ~75% | ~90% |
]
]
.pull-right[
.mermaid[
graph LR
CMakeSuccess["CMake ๐ต\n~75% success\nrate"] --> Agent["AI Agent ๐ค"]
XMakeSuccess["XMake ๐ข\n~90% success\nrate"] --> Agent
style CMakeSuccess fill:#ff9800
style XMakeSuccess fill:#4caf50
style Agent fill:#9c27b0
]
]
**Simpler build system = higher agent success rate** ๐
---
### Dimension 5: Hallucination Risk โ ๏ธ
What happens when AI generates incorrect build code:
.mermaid[
graph LR
A["AI generates\nbuild code"] --> B{"Build system?"}
B -->|"CMake ๐ต"| C["More ways to fail:\n- Wrong variable name\n- Deprecated pattern\n- Mixed old/new syntax\n- Generator expression errors"]
B -->|"XMake ๐ข"| D["Fewer ways to fail:\n- Simple Lua API\n- Consistent syntax\n- One way to do things"]
C --> E["Build fails ๐ฐ\nAgent must debug"]
D --> F["Build succeeds โ
\nOr clear error"]
style A fill:#9c27b0
style B fill:#f44336
style C fill:#ff9800
style D fill:#4caf50
style E fill:#f44336
style F fill:#4caf50
]
> CMake's **surface area for hallucination** is much larger. XMake constrains the AI to correct patterns. ๐ฏ
---
### AI Era Scorecard ๐
.font-sm[
| Dimension | CMake ๐ต | XMake ๐ข | Winner |
|-----------|:--------:|:--------:|:------:|
| **Token efficiency** | 4,500 tokens | 2,000 tokens | ๐ข 2.3ร |
| **AI generation accuracy** | High hallucination risk | Low hallucination risk | ๐ข |
| **Error diagnosis** | Multi-file tracing | Single-file reading | ๐ข |
| **Agentic success rate** | ~75% | ~90% | ๐ข |
| **CI/CD integration** | Universal | Growing | ๐ต |
| **Install/packaging** | First-class | Limited | ๐ต |
| **Ecosystem** | 25+ years | ~6 years | ๐ต |
]
> **Score: CMake 3 โ XMake 4** โ XMake wins the AI era! ๐ค
---
class: nord-light, middle, center
## ๐ Part 4: The Verdict
---
### When to Use Which ๐
.font-sm[
| Scenario | Recommendation | Why |
|----------|:--------------:|-----|
| **Local dev with AI** ๐ค | **XMake** ๐ข | Faster iteration, fewer agent errors |
| **CI/CD pipeline** ๐ | **CMake** ๐ต | Universal CI support, pre-installed |
| **Open-source library** ๐ฆ | **CMake** ๐ต | Downstream expects find_package() |
| **Rapid prototyping** โก | **XMake** ๐ข | One command, one file, done |
| **Enterprise project** ๐ข | **CMake** ๐ต | Team familiarity, tooling, compliance |
| **Embedded/cross-compile** ๐ | **CMake** ๐ต | Mature toolchain file system |
| **Solo dev + AI agent** ๐งโ๐ป | **XMake** ๐ข | Maximum productivity |
]
---
### The Pragmatic Strategy ๐ฏ
.mermaid[
graph LR
A["Development\nPhase ๐ ๏ธ"] -->|"XMake ๐ข"| B["Fast iteration\nAI-assisted coding\nOne-command builds"]
B --> C["Testing\nPhase ๐งช"]
C -->|"XMake ๐ข\nLocal tests"| N(( ))
style A fill:#9c27b0
style B fill:#4caf50
style C fill:#2196f3
]
.mermaid[
graph LR
N(( )) --> D["Ready to ship?"]
D -->|"Yes โ
"| E["CI/CD\nPhase ๐"]
E -->|"CMake ๐ต"| F["GitHub Actions\nPackaging\nfind_package() export"]
F --> G["Release ๐"]
style D fill:#ff9800
style E fill:#2196f3
style F fill:#2196f3
style G fill:#4caf50,color:#fff
]
> **Use XMake to code faster with AI, use CMake to ship.** This is the optimal strategy. ๐
---
### This Project: A Real Example ๐ญ
This project **already uses both**:
.pull-left[
**XMake โ Dev Loop** ๐ข
```bash
# Local development
xmake # build
xmake run MultiplierlessTests # test
xmake run MultiplierlessStandalone
```
- Faster iteration
- AI agent reads 1 file
- One command per action
]
.pull-right[
**CMake โ CI & Packaging** ๐ต
```bash
# GitHub Actions (windows.yml)
cmake -S. -Bbuild
cmake --build build --config Debug
ctest --build-config Debug
# Install target
packageProject(...)
```
- CI pipelines
- find_package() export
- Version headers
]
The dual-build approach is **intentional** โ each system does what it does best. ๐ฏ
---
### The Math Behind the Decision ๐
Let **Tc** = time saved per AI interaction with XMake, **N** = interactions per day:
> **Daily savings** = N ร Tc โ 10 ร 2.5s = **25s/day**
> **Annual savings** โ 25 ร 250 = 6,250s โ **1.7 hours/year**
But the **real** savings is in **error reduction**:
> **P(AI error | CMake) โ 25%**
> **P(AI error | XMake) โ 10%**
> **Error reduction** = (25% โ 10%) / 25% = **60% fewer failures**
> **60% fewer AI failures** is the real ROI of XMake for development. ๐ก
---
### Future Outlook ๐ฎ
.mermaid[
graph TD
subgraph Now["Today (2026)"]
C1["CMake: Dominant\nin CI/CD"]
X1["XMake: Growing\nin dev workflows"]
end
subgraph Near["Near Future (2027โ2028)"]
C2["CMake: Still\nCI standard"]
X2["XMake: Better\nIDE integration"]
AI["AI Agents: Mature\nAuto-build-system selection"]
end
subgraph Far["Far Future (2030+)"]
C3["CMake: Legacy\nmaintenance mode"]
X3["XMake: Possible\nnew standard?"]
New["New system?\nAI-native build system?"]
end
Now --> Near --> Far
style Now fill:#e3f2fd
style Near fill:#fff3e0
style Far fill:#f3e5f5
style C1 fill:#2196f3
style X1 fill:#4caf50
style C2 fill:#2196f3
style X2 fill:#4caf50
style AI fill:#9c27b0
style C3 fill:#2196f3
style X3 fill:#4caf50
style New fill:#f44336
]
> The **AI era** may produce a new build system designed from scratch for agent-assisted coding. ๐ค
---
### Key Takeaways ๐ผ๏ธ
.mermaid[
graph TD
Q["CMake vs XMake\nin the AI Era?"] --> R1["๐ต CMake wins\nCI/CD, packaging,\necosystem"]
Q --> R2["๐ข XMake wins\ntokens, accuracy,\nerror diagnosis"]
Q --> R3["๐ค Use both\nXMake for dev\nCMake for ship"]
style Q fill:#ff9800,stroke:#e65100,stroke-width:3px
style R1 fill:#2196f3,color:#fff
style R2 fill:#4caf50,color:#fff
style R3 fill:#9c27b0,color:#fff
]
.font-sm[
| Traditional View | AI-Era View |
|------------------|-------------|
| CMake = standard | CMake = expensive for AI |
| XMake = niche | XMake = AI-optimized |
| Pick one | **Use both strategically** |
]
> ๐ฆ This project: [`luk036/multiplierless-cpp`](https://github.com/luk036/multiplierless-cpp) ยท Dual build system (CMake + XMake)
---
count: false
class: nord-dark, middle, center
## ๐ Q&A
**CMake vs XMake in the AI Era**
*Questions?* ๐ค
---
count: false
class: nord-dark, middle, center
# ๐ Thank You!
## Build Smarter with AI! ๐ค โ๏ธ ๐