UseSWIG: Fix handling of SWIG_MODULE_NAME source file property

Fix a typo from commit 0bef9eb410 (UseSWIG: modernize module,
2018-01-29) that caused `UseSWIG` to ignore an eventually set property
`SWIG_MODLUE_NAME`.

Building multiple python modules using the mentioned property as
described in the docs could lead to an invalid, or even worse,
inconsistent `build.ninja` file.  The reason is that the generated list
of support files was not unique.  For each module the support file was
always named the same, namely `path/to/builddir/MODULENAME.py`.
This commit is contained in:
Felix Schwitzer
2018-06-11 20:24:41 +02:00
committed by Brad King
parent 90ebc32d9e
commit 156138d5f1

View File

@@ -237,7 +237,7 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
set(files)
get_source_file_property(module_basename
"${infile}" SWIG_MODULE_NAME)
if(NOT swig_module_basename)
if(NOT module_basename)
# try to get module name from "%module foo" syntax
if ( EXISTS "${infile}" )