C# CMake build generates win-x64 RuntimeIdentifier for Visual Studio Win32 builds
envgap__OSGeo__gdal-14872
01 / FAILURE SIGNATURE
As reported upstream
`error NETSDK1032: The RuntimeIdentifier platform 'win-x64' and the PlatformTarget 'x86' must be compatible.`
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
42f1aa59031ea95800d4805e268b3cf70f9def20- Manifest
swig/csharp/CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
OSGeo/gdal #14872 · read the original issue
### What is the bug? After the RFC112 C# binding CMake rewrite, GDAL derives CSHARP_RID from CMAKE_SYSTEM_PROCESSOR. On Windows Visual Studio generators this can describe the host CPU, not the target platform. The corresponding failure is: `error NETSDK1032: The RuntimeIdentifier platform 'win-x64' and the PlatformTarget 'x86' must be compatible.` ### Steps to reproduce the issue 1. Configure GDAL master on a 64-bit Windows host with Visual Studio 2022 targeting Win32/x86. 2. Enable C# bindings. 3. Build the install target. ``` cmake .. -G "Visual Studio 17 2022" -A Win32 -DBUILD_CSHARP_BINDINGS=ON cmake --build . --config Release --target install ``` ### Versions and provenance Observed in GDAL master after: 71c45339ba4c9ba9d1a520a4aa0c55c0f2d1fd04 implement rfc-112 Last known working revision in the GISInternals daily x86 build: ccc9feb81fb119ca0b890ac03968eb2f9978b8ca Environment: Windows Visual Studio 2022 NMake/MSBuild toolset 14.44.35222.0 .NET SDK 9.0.309 CMake generator platform: Win32 ### Additional context _No response_
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]