You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -175,10 +175,34 @@ make debug VERBOSE=1
175
175
# Release build without Link-Time Optimization (faster linking)
176
176
make release USE_LTO=false
177
177
178
+
# Compiler-aware LTO (automatic: thin for Clang, auto for GCC)
179
+
make release CXX=clang++ # Uses -flto=thin (optimized for Clang)
180
+
make release CXX=g++ # Uses -flto=auto (optimized for GCC)
181
+
178
182
# Parallel build with 8 cores (release configuration)
179
183
make -j8 release
180
184
```
181
185
186
+
## 🔗 Link-Time Optimization (LTO)
187
+
188
+
The Makefile automatically selects the best LTO variant based on your compiler:
189
+
190
+
| Compiler | LTO Type | Benefit |
191
+
|----------|----------|---------|
192
+
|**Clang/clang++**|`-flto=thin`| Faster compilation, good optimization |
193
+
|**GCC/g++**|`-flto=auto`| Best optimization, slower linking |
194
+
|**Disabled**| (none) | Fastest build time |
195
+
196
+
```bash
197
+
# Enable LTO (default in release builds)
198
+
make release USE_LTO=true CXX=clang++ # Automatically uses thin LTO
199
+
200
+
# Disable LTO if linking is too slow
201
+
make release USE_LTO=false
202
+
```
203
+
204
+
### Parallel build with 8 cores (release configuration)
205
+
182
206
## 🔍 Compiler Warning Levels
183
207
184
208
Control compiler warning strictness with the **`WARN_LEVEL`** variable. Perfect for managing warnings in different project phases or integrating with CI/CD pipelines.
0 commit comments