mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
UseSWIG: Change the library suffix to 'dylib' for C# on macOS
When testing on macOS, the command `swig_add_library("mytarget")`
creates a library `libmytarget.so` instead of `libmytarget.dylib`.
Subsequently, the library is not found by `dotnet` and the
swig-generated `DllImport` statements.
Fixes: #23967
This commit is contained in:
committed by
Brad King
parent
12de4ea2e8
commit
6b14de6bc5
@@ -990,6 +990,9 @@ function(SWIG_ADD_LIBRARY name)
|
||||
endif()
|
||||
set_target_properties (${target_name} PROPERTIES PREFIX "")
|
||||
endif()
|
||||
if (APPLE)
|
||||
set_target_properties (${target_name} PROPERTIES SUFFIX ".dylib")
|
||||
endif ()
|
||||
else()
|
||||
# assume empty prefix because we expect the module to be dynamically loaded
|
||||
set_target_properties (${target_name} PROPERTIES PREFIX "")
|
||||
|
||||
Reference in New Issue
Block a user