mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-10 20:07:37 +00:00
WoW.exe is x86, so there is no valid 64-bit configure. Nothing in the repo said so, which let VS Code decide instead: CMake Tools configures on folder open by default, and with no presets file it takes the architecture from a scanned kit. Here it chose the x86_amd64 cross kit (-T host=x86 -A x64) and flipped the shared build directory to x64. That failure is badly disguised. A 64-bit build first shows up as a static_assert deep in a struct-layout check, which reads as an unrelated code fault rather than a build-configuration one. Add CMakePresets.json with a single win32 configure preset. A presets file makes CMake Tools use presets and stop using kits, so the architecture becomes a property of the project instead of whichever kit a machine happens to select. The preset names no generator, matching the documented command line: CMake then resolves the newest installed Visual Studio, which a pinned version would get wrong. Schema version 3 is the earliest that allows omitting the generator. Add a CMAKE_SIZEOF_VOID_P guard after project() for whatever gets past the preset -- a hand-typed -A x64, or a stale cache -- so the configure fails with the recovery steps instead of building something unloadable. The existing `cmake -B build -A Win32` flow keeps working; presets are opt-in on the command line.
26 lines
652 B
JSON
26 lines
652 B
JSON
{
|
|
"version": 3,
|
|
"cmakeMinimumRequired": {
|
|
"major": 3,
|
|
"minor": 21,
|
|
"patch": 0
|
|
},
|
|
"configurePresets": [
|
|
{
|
|
"name": "win32",
|
|
"displayName": "Win32 (x86)",
|
|
"description": "The only supported configuration: WoW.exe is 32-bit, so the DLL must be 32-bit too. No generator is named, so CMake picks the newest installed Visual Studio, matching the documented command line.",
|
|
"binaryDir": "${sourceDir}/build",
|
|
"architecture": "Win32"
|
|
}
|
|
],
|
|
"buildPresets": [
|
|
{
|
|
"name": "release",
|
|
"displayName": "Release",
|
|
"configurePreset": "win32",
|
|
"configuration": "Release"
|
|
}
|
|
]
|
|
}
|