The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=13814 
====================================================================== 
Reported By:                Matt Williams
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13814
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-12-26 11:51 EST
Last Modified:              2012-12-26 11:51 EST
====================================================================== 
Summary:                    SWIG C# generates a DllImport line that doesn't
match the library name
Description: 
When creating C# bindings with UseSWIG like:

  swig_add_module(MyModuleCSharp csharp MyModule.i)

then SWIG will generate code containing

  [DllImport("MyModule", EntryPoint="...")]

but the library name generated by CMake will be something like
libMyModuleCSharp.so (note the 'CSharp' suffix). This causes the generated
bindings to crash unless the library and module names just happen to match.

SWIG provides an argument to set the DllImport name to something else. By
passing "-dllimport MyModuleCSharp" the DllImport line will contain the correct
library name.

  [DllImport("MyModuleCSharp", EntryPoint="...")]

Attached is a patch which implements this inside SWIG_MODULE_INITIALIZE.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-12-26 11:51 Matt Williams  New Issue                                    
2012-12-26 11:51 Matt Williams  File Added: swig_csharp_dllimport.patch         
          
======================================================================

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to