[mapguide-commits] r10246 - in branches/4.0/MgDev/Bindings/src/Bindings/DotNet: Foundation Geometry MapGuideCommon PlatformBase Portable Web

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Nov 2 16:30:54 PST 2026


Author: jng
Date: 2026-11-02 16:30:53 -0800 (Mon, 02 Nov 2026)
New Revision: 10246

Modified:
   branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Foundation/CMakeLists.txt
   branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Geometry/CMakeLists.txt
   branches/4.0/MgDev/Bindings/src/Bindings/DotNet/MapGuideCommon/CMakeLists.txt
   branches/4.0/MgDev/Bindings/src/Bindings/DotNet/PlatformBase/CMakeLists.txt
   branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/CMakeLists.txt
   branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Web/CMakeLists.txt
Log:
#2493: Use same SWIG flags for dotnet bindings on Linux as Windows

Modified: branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Foundation/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Foundation/CMakeLists.txt	2026-11-03 00:11:28 UTC (rev 10245)
+++ branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Foundation/CMakeLists.txt	2026-11-03 00:30:53 UTC (rev 10246)
@@ -33,13 +33,13 @@
 endif (WIN32)
 
 message(STATUS "Using IMake at: ${IMAKE_TOOL}")
-# SWIG_CSHARP_NO_WSTRING_HELPER is deliberately absent: SWIG 4.3 still emits the
-# references to SWIGWStringHelper while no longer emitting the class itself, so the
-# generated code does not compile (CS0103). Letting the helper be generated is
-# correct on both 4.0 and 4.3 - each module is generated into its own assembly, so
-# there is nothing for it to collide with. The other two suppressions are honoured
-# consistently and stay. The Windows build sets all three from *.vcxproj and does not
-# use this file.
+# The SWIG suppressions are the same set the Windows project (*.vcxproj) passes, and they have
+# to stay in step: both platforms generate the C# with SWIG 4.3.1 (here from the build
+# cmake_bootstrap.sh makes, on Windows from the 4.3.1 binary install $(SWIG_DIR) points at), so
+# the flags are what decide whether the two produce the same C#. SWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
+# is required, not optional: 4.3 no longer emits the SWIGWStringHelper class, and without that
+# flag the exception helper still references it, so the generated code does not compile (CS0103).
+# Suppressing the class instead of its remaining user is the mistake to avoid.
 add_custom_command(OUTPUT ${FoundationUnmanagedApi_SRCS}
     COMMAND ${CMAKE_COMMAND} -E echo Removing: ${MG_DOTNET_PROJECT_DIR}/*.cs
     COMMAND ${CMAKE_COMMAND} -E remove -f 
@@ -69,6 +69,8 @@
     COMMAND ${SWIG_EXECUTABLE} -c++ -csharp 
             ${SWIG_DOTNET_DEFS} -DDOTNETCORE -DSWIG_CSHARP_NO_EXCEPTION_HELPER
             -DSWIG_CSHARP_NO_STRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
             -namespace OSGeo.MapGuide
             -nodefaultctor -nodefaultdtor
             -module FoundationUnmanagedApi

Modified: branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Geometry/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Geometry/CMakeLists.txt	2026-11-03 00:11:28 UTC (rev 10245)
+++ branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Geometry/CMakeLists.txt	2026-11-03 00:30:53 UTC (rev 10246)
@@ -37,13 +37,13 @@
 endif (WIN32)
 
 message(STATUS "Using IMake at: ${IMAKE_TOOL}")
-# SWIG_CSHARP_NO_WSTRING_HELPER is deliberately absent: SWIG 4.3 still emits the
-# references to SWIGWStringHelper while no longer emitting the class itself, so the
-# generated code does not compile (CS0103). Letting the helper be generated is
-# correct on both 4.0 and 4.3 - each module is generated into its own assembly, so
-# there is nothing for it to collide with. The other two suppressions are honoured
-# consistently and stay. The Windows build sets all three from *.vcxproj and does not
-# use this file.
+# The SWIG suppressions are the same set the Windows project (*.vcxproj) passes, and they have
+# to stay in step: both platforms generate the C# with SWIG 4.3.1 (here from the build
+# cmake_bootstrap.sh makes, on Windows from the 4.3.1 binary install $(SWIG_DIR) points at), so
+# the flags are what decide whether the two produce the same C#. SWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
+# is required, not optional: 4.3 no longer emits the SWIGWStringHelper class, and without that
+# flag the exception helper still references it, so the generated code does not compile (CS0103).
+# Suppressing the class instead of its remaining user is the mistake to avoid.
 add_custom_command(OUTPUT ${GeometryUnmanagedApi_SRCS}
     COMMAND ${CMAKE_COMMAND} -E echo Removing: ${MG_DOTNET_PROJECT_DIR}/*.cs
     COMMAND ${CMAKE_COMMAND} -E remove -f 
@@ -73,6 +73,8 @@
     COMMAND ${SWIG_EXECUTABLE} -c++ -csharp 
             ${SWIG_DOTNET_DEFS} -DDOTNETCORE -DSWIG_CSHARP_NO_EXCEPTION_HELPER
             -DSWIG_CSHARP_NO_STRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
             -namespace OSGeo.MapGuide
             -nodefaultctor -nodefaultdtor
             -module GeometryUnmanagedApi

Modified: branches/4.0/MgDev/Bindings/src/Bindings/DotNet/MapGuideCommon/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Bindings/src/Bindings/DotNet/MapGuideCommon/CMakeLists.txt	2026-11-03 00:11:28 UTC (rev 10245)
+++ branches/4.0/MgDev/Bindings/src/Bindings/DotNet/MapGuideCommon/CMakeLists.txt	2026-11-03 00:30:53 UTC (rev 10246)
@@ -34,13 +34,13 @@
 endif (WIN32)
 
 message(STATUS "Using IMake at: ${IMAKE_TOOL}")
-# SWIG_CSHARP_NO_WSTRING_HELPER is deliberately absent: SWIG 4.3 still emits the
-# references to SWIGWStringHelper while no longer emitting the class itself, so the
-# generated code does not compile (CS0103). Letting the helper be generated is
-# correct on both 4.0 and 4.3 - each module is generated into its own assembly, so
-# there is nothing for it to collide with. The other two suppressions are honoured
-# consistently and stay. The Windows build sets all three from *.vcxproj and does not
-# use this file.
+# The SWIG suppressions are the same set the Windows project (*.vcxproj) passes, and they have
+# to stay in step: both platforms generate the C# with SWIG 4.3.1 (here from the build
+# cmake_bootstrap.sh makes, on Windows from the 4.3.1 binary install $(SWIG_DIR) points at), so
+# the flags are what decide whether the two produce the same C#. SWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
+# is required, not optional: 4.3 no longer emits the SWIGWStringHelper class, and without that
+# flag the exception helper still references it, so the generated code does not compile (CS0103).
+# Suppressing the class instead of its remaining user is the mistake to avoid.
 add_custom_command(OUTPUT ${MapGuideCommonUnmanagedApi_SRCS}
     COMMAND ${CMAKE_COMMAND} -E echo Removing: ${MG_DOTNET_PROJECT_DIR}/*.cs
     COMMAND ${CMAKE_COMMAND} -E remove -f 
@@ -74,6 +74,8 @@
     COMMAND ${SWIG_EXECUTABLE} -c++ -csharp 
             ${SWIG_DOTNET_DEFS} -DDOTNETCORE -DSWIG_CSHARP_NO_EXCEPTION_HELPER
             -DSWIG_CSHARP_NO_STRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
             -namespace OSGeo.MapGuide
             -nodefaultctor -nodefaultdtor
             -module MapGuideCommonUnmanagedApi

Modified: branches/4.0/MgDev/Bindings/src/Bindings/DotNet/PlatformBase/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Bindings/src/Bindings/DotNet/PlatformBase/CMakeLists.txt	2026-11-03 00:11:28 UTC (rev 10245)
+++ branches/4.0/MgDev/Bindings/src/Bindings/DotNet/PlatformBase/CMakeLists.txt	2026-11-03 00:30:53 UTC (rev 10246)
@@ -34,13 +34,13 @@
 endif (WIN32)
 
 message(STATUS "Using IMake at: ${IMAKE_TOOL}")
-# SWIG_CSHARP_NO_WSTRING_HELPER is deliberately absent: SWIG 4.3 still emits the
-# references to SWIGWStringHelper while no longer emitting the class itself, so the
-# generated code does not compile (CS0103). Letting the helper be generated is
-# correct on both 4.0 and 4.3 - each module is generated into its own assembly, so
-# there is nothing for it to collide with. The other two suppressions are honoured
-# consistently and stay. The Windows build sets all three from *.vcxproj and does not
-# use this file.
+# The SWIG suppressions are the same set the Windows project (*.vcxproj) passes, and they have
+# to stay in step: both platforms generate the C# with SWIG 4.3.1 (here from the build
+# cmake_bootstrap.sh makes, on Windows from the 4.3.1 binary install $(SWIG_DIR) points at), so
+# the flags are what decide whether the two produce the same C#. SWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
+# is required, not optional: 4.3 no longer emits the SWIGWStringHelper class, and without that
+# flag the exception helper still references it, so the generated code does not compile (CS0103).
+# Suppressing the class instead of its remaining user is the mistake to avoid.
 add_custom_command(OUTPUT ${PlatformBaseUnmanagedApi_SRCS}
     COMMAND ${CMAKE_COMMAND} -E echo Removing: ${MG_DOTNET_PROJECT_DIR}/*.cs
     COMMAND ${CMAKE_COMMAND} -E remove -f 
@@ -70,6 +70,8 @@
     COMMAND ${SWIG_EXECUTABLE} -c++ -csharp 
             ${SWIG_DOTNET_DEFS} -DDOTNETCORE -DSWIG_CSHARP_NO_EXCEPTION_HELPER
             -DSWIG_CSHARP_NO_STRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
             -namespace OSGeo.MapGuide
             -nodefaultctor -nodefaultdtor
             -module PlatformBaseUnmanagedApi

Modified: branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/CMakeLists.txt	2026-11-03 00:11:28 UTC (rev 10245)
+++ branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/CMakeLists.txt	2026-11-03 00:30:53 UTC (rev 10246)
@@ -31,13 +31,13 @@
 endif (WIN32)
 
 message(STATUS "Using IMake at: ${IMAKE_TOOL}")
-# SWIG_CSHARP_NO_WSTRING_HELPER is deliberately absent: SWIG 4.3 still emits the
-# references to SWIGWStringHelper while no longer emitting the class itself, so the
-# generated code does not compile (CS0103). Letting the helper be generated is
-# correct on both 4.0 and 4.3 - each module is generated into its own assembly, so
-# there is nothing for it to collide with. The other two suppressions are honoured
-# consistently and stay. The Windows build sets all three from *.vcxproj and does not
-# use this file.
+# The SWIG suppressions are the same set the Windows project (*.vcxproj) passes, and they have
+# to stay in step: both platforms generate the C# with SWIG 4.3.1 (here from the build
+# cmake_bootstrap.sh makes, on Windows from the 4.3.1 binary install $(SWIG_DIR) points at), so
+# the flags are what decide whether the two produce the same C#. SWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
+# is required, not optional: 4.3 no longer emits the SWIGWStringHelper class, and without that
+# flag the exception helper still references it, so the generated code does not compile (CS0103).
+# Suppressing the class instead of its remaining user is the mistake to avoid.
 add_custom_command(OUTPUT ${PortableUnmanagedApi_SRCS}
     COMMAND ${CMAKE_COMMAND} -E echo Removing: ${MG_DOTNET_PROJECT_DIR}/*.cs
     COMMAND ${CMAKE_COMMAND} -E remove -f 
@@ -71,6 +71,8 @@
     COMMAND ${SWIG_EXECUTABLE} -c++ -csharp 
             ${SWIG_DOTNET_DEFS} -DDOTNETCORE -DSWIG_CSHARP_NO_EXCEPTION_HELPER
             -DSWIG_CSHARP_NO_STRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
             -namespace OSGeo.MapGuide
             -nodefaultctor -nodefaultdtor
             -module PortableUnmanagedApi

Modified: branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Web/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Web/CMakeLists.txt	2026-11-03 00:11:28 UTC (rev 10245)
+++ branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Web/CMakeLists.txt	2026-11-03 00:30:53 UTC (rev 10246)
@@ -37,13 +37,13 @@
 endif (WIN32)
 
 message(STATUS "Using IMake at: ${IMAKE_TOOL}")
-# SWIG_CSHARP_NO_WSTRING_HELPER is deliberately absent: SWIG 4.3 still emits the
-# references to SWIGWStringHelper while no longer emitting the class itself, so the
-# generated code does not compile (CS0103). Letting the helper be generated is
-# correct on both 4.0 and 4.3 - each module is generated into its own assembly, so
-# there is nothing for it to collide with. The other two suppressions are honoured
-# consistently and stay. The Windows build sets all three from *.vcxproj and does not
-# use this file.
+# The SWIG suppressions are the same set the Windows project (*.vcxproj) passes, and they have
+# to stay in step: both platforms generate the C# with SWIG 4.3.1 (here from the build
+# cmake_bootstrap.sh makes, on Windows from the 4.3.1 binary install $(SWIG_DIR) points at), so
+# the flags are what decide whether the two produce the same C#. SWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
+# is required, not optional: 4.3 no longer emits the SWIGWStringHelper class, and without that
+# flag the exception helper still references it, so the generated code does not compile (CS0103).
+# Suppressing the class instead of its remaining user is the mistake to avoid.
 add_custom_command(OUTPUT ${WebUnmanagedApi_SRCS}
     COMMAND ${CMAKE_COMMAND} -E echo Removing: ${MG_DOTNET_PROJECT_DIR}/*.cs
     COMMAND ${CMAKE_COMMAND} -E remove -f 
@@ -73,6 +73,8 @@
     COMMAND ${SWIG_EXECUTABLE} -c++ -csharp 
             ${SWIG_DOTNET_DEFS} -DDOTNETCORE -DSWIG_CSHARP_NO_EXCEPTION_HELPER
             -DSWIG_CSHARP_NO_STRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_HELPER
+            -DSWIG_CSHARP_NO_WSTRING_EXCEPTION_HELPER
             -namespace OSGeo.MapGuide
             -nodefaultctor -nodefaultdtor
             -module WebUnmanagedApi



More information about the mapguide-commits mailing list