summaryrefslogtreecommitdiffstats
path: root/Modules/UseSWIG.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/UseSWIG.cmake')
-rw-r--r--Modules/UseSWIG.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 18ea55c..c136b05 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -466,7 +466,14 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
if(NOT ("-dllimport" IN_LIST swig_source_file_flags OR "-dllimport" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS))
# This makes sure that the name used in the generated DllImport
# matches the library name created by CMake
- list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport" "${name}")
+ list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport" "$<TARGET_FILE_PREFIX:${target_name}>$<TARGET_FILE_BASE_NAME:${target_name}>")
+ endif()
+ endif()
+ if (SWIG_MODULE_${name}_LANGUAGE STREQUAL "PYTHON" AND NOT SWIG_MODULE_${name}_NOPROXY)
+ if(NOT ("-interface" IN_LIST swig_source_file_flags OR "-interface" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS))
+ # This makes sure that the name used in the proxy code
+ # matches the library name created by CMake
+ list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-interface" "$<TARGET_FILE_PREFIX:${target_name}>$<TARGET_FILE_BASE_NAME:${target_name}>")
endif()
endif()
list (APPEND swig_extra_flags ${SWIG_MODULE_${name}_EXTRA_FLAGS})