diff --git a/cmake/modules/SwiftSupport.cmake b/cmake/modules/SwiftSupport.cmake index ead1958b8..ebdfd5d92 100644 --- a/cmake/modules/SwiftSupport.cmake +++ b/cmake/modules/SwiftSupport.cmake @@ -133,7 +133,11 @@ function(add_swift_target target) endif() if(AST_LIBRARY) - set(emit_library -emit-library) + if(CMAKE_SYSTEM_NAME STREQUAL Windows OR CMAKE_SYSTEM_NAME STREQUAL Darwin) + set(emit_library -emit-library) + else() + set(emit_library -emit-library -Xlinker -soname -Xlinker ${AST_OUTPUT}) + endif() endif() if(NOT AST_LIBRARY OR library_kind STREQUAL SHARED) add_custom_command(OUTPUT