Identify legacy .swg files as Swig module files as well
We're in the process of porting some old code from Python 2 to Python 3 and also integrating with CMake.
We found some legacy code where Swig module files names end with extension .swg
. I thought of renaming them to .i
, but a quick search showed us that Swig modules could have the .swg
extension as well. Internally, just changing the following line in UseSWIG.cmake
unblocked us.
list(FILTER swig_dot_i_sources INCLUDE REGEX "\\.i$")
<<TO>>
list(FILTER swig_dot_i_sources INCLUDE REGEX "\\.i$|\\.swg$")
This should be a one-liner fix, I can submit a patch myself.