Problem I'm trying to solve in shortest example looks like that. I have 2 swig's interface files.
- first swig file
Common.i
looks like that:
/* Common.i */
%module Common
%include "Common.hpp"
I generate swig wrappers with command:
swig -c++ -java -package com.wrappers.Common -outdir "wrappers/Common" -o "wrappers_cpp/swig_Common_wrapper.cpp" "Common.i"
Common.hpp
has definitions of class A
and B
, so this swig command above generates files A.java
and B.java
in catalog wrappers/Common
- second swig file
Example.i
looks like that:
/* Example.i */
%module Example
%include "Common.i"
%include "Example.hpp"
and again I generate swig wrappers with command:
swig -c++ -java -package com.wrappers.Example -outdir "wrappers/Example" -o "wrappers_cpp/swig_Example_wrapper.cpp" "Example.i"
And here my problem begins:
In catalog wrappers/Example
I have duplicate files A.java
and B.java
, because I included Common.i
in Example.i
.
I would like to have one copy of those classes above.
Is there a way to avoid this duplication?