]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
bos #29863 [CEA 29586] MEDCouplingBascisTest failing: SWIG 4 compatibility (temporary... vsr/29863 V9_9_0rc1
authorvsr <vsr@opencascade.com>
Thu, 12 May 2022 10:43:01 +0000 (13:43 +0300)
committervsr <vsr@opencascade.com>
Thu, 12 May 2022 10:43:01 +0000 (13:43 +0300)
CMakeLists.txt
src/MEDCoupling_Swig/MEDCouplingRefCountObject.i

index 842dd4aeebce39ca0aabc73625ab0ce235ca4fe2..8064b103d79896f6555a6372067ec3b813898614 100644 (file)
@@ -211,6 +211,14 @@ IF(MEDCOUPLING_ENABLE_PYTHON)
   IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
       MESSAGE(STATUS "Using Python 3")
   ENDIF()
+  IF ("${SWIG_VERSION}" VERSION_GREATER_EQUAL "4")
+    SET(MEDCOUPLING_SWIG4_COMPAT TRUE CACHE BOOL "SWIG 4 compatibility (experimental)")
+  ELSE()
+    SET(MEDCOUPLING_SWIG4_COMPAT FALSE)
+  ENDIF()
+  IF(MEDCOUPLING_SWIG4_COMPAT)
+    LIST(APPEND CMAKE_SWIG_FLAGS "-DMEDCOUPLING_SWIG4_COMPAT")
+  ENDIF()
 ENDIF(MEDCOUPLING_ENABLE_PYTHON)
 
 IF(MEDCOUPLING_BUILD_DOC)
index cae752fff2868295966d2bed081df0ee8ff5c5e0..7e363eaf3d24fc9afa904b0b2dfb3ed8843e6ee5 100644 (file)
@@ -47,7 +47,11 @@ namespace INTERP_KERNEL
   catch (INTERP_KERNEL::Exception& _e) {
     // Reraise with SWIG_Python_Raise
     SWIG_Python_Raise(SWIG_NewPointerObj((new INTERP_KERNEL::Exception(static_cast< const INTERP_KERNEL::Exception& >(_e))),SWIGTYPE_p_INTERP_KERNEL__Exception,SWIG_POINTER_OWN), "INTERP_KERNEL::Exception", SWIGTYPE_p_INTERP_KERNEL__Exception);
+#ifdef MEDCOUPLING_SWIG4_COMPAT
+    return nullptr;
+#else
     SWIG_fail;
+#endif
   }
 }