diff options
author | Brad King <brad.king@kitware.com> | 2020-09-01 13:08:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-01 13:08:06 (GMT) |
commit | ec0d621e36de4b00fa4d8fe1bbcf21be2079fd73 (patch) | |
tree | 04d57c2bcb73b7ed5439299f36f89884b337e5d4 /Modules/UseSWIG.cmake | |
parent | 8c833ff0e17e63d9cbf17622abcb70a5fab240b8 (diff) | |
parent | d264685bee6a0d0598d46f5bc3e81f7231aa0c53 (diff) | |
download | CMake-ec0d621e36de4b00fa4d8fe1bbcf21be2079fd73.zip CMake-ec0d621e36de4b00fa4d8fe1bbcf21be2079fd73.tar.gz CMake-ec0d621e36de4b00fa4d8fe1bbcf21be2079fd73.tar.bz2 |
Merge topic 'UseSWIG-interface-option'
d264685bee UseSWIG: Update option -interface usage
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5172
Diffstat (limited to 'Modules/UseSWIG.cmake')
-rw-r--r-- | Modules/UseSWIG.cmake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index b75eb5e..59a0707 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -496,7 +496,8 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) 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)) + if(SWIG_USE_INTERFACE AND + 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}>") @@ -724,6 +725,13 @@ function(SWIG_ADD_LIBRARY name) set(swig_generated_sources) set(swig_generated_timestamps) + list(LENGTH swig_dot_i_sources swig_sources_count) + if (swig_sources_count GREATER "1") + # option -interface cannot be used + set(SWIG_USE_INTERFACE FALSE) + else() + set(SWIG_USE_INTERFACE TRUE) + endif() foreach(swig_it IN LISTS swig_dot_i_sources) SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source "${swig_it}") list (APPEND swig_generated_sources "${swig_generated_source}") |