win: document LNK1248 causes and the USE_CCACHE escape hatch

Building IfcGeom with many schemas can exceed MSVC's 4GB image size
limit in two ways reported in issue 7461: the /Z7 embedded debug format
that ccache requires, and /GL whole-program optimization in the schema
mappings. The first has a configure-time switch and the second is now
handled automatically, but neither was discoverable from the Windows
build documentation.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Petru Conduraru
2026-07-19 23:40:15 +03:00
parent 89523999b3
commit 534cef626e
+19
View File
@@ -119,3 +119,22 @@ Directory Structure
\---patches - Contains patches for the dependencies
\---utils - Contains various utilities for the build scripts
```
Troubleshooting
---------------
### fatal error LNK1248: image size exceeds maximum
Building `IfcGeom` with many schemas can exceed the 4GB image size limit of
MSVC's librarian in two situations, both tracked in issue 7461:
- **Debug or RelWithDebInfo builds with ccache enabled.** ccache requires the
embedded `/Z7` debug information format, which bloats object files compared
to the default `/Zi` PDB format. Configure with `-DUSE_CCACHE=OFF` (added to
`run-cmake.bat` arguments) to restore the PDB format, or reduce the number
of schemas with `-DSCHEMA_VERSIONS`.
- **Release builds with `ENABLE_BUILD_OPTIMIZATIONS`.** The `/GL` whole-program
optimization flag makes the per-schema mapping objects very large. The build
now automatically compiles each schema mapping as a separate static library
on MSVC in this configuration, which avoids the limit; no action is needed on
a current checkout.