Always set the compatibility_version of linked dylibs on Darwin.

Use 1.0.0 when there is no more-specific SWIFT_COMPILER_VERSION.

(cherry picked from commit 00485afc68)
This commit is contained in:
Doug Gregor 2019-01-15 14:35:21 -08:00 коммит произвёл Ross Bayer
Родитель a8126fb484
Коммит 252ac2b554
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -753,9 +753,10 @@ function(_add_swift_library_single target name)
endif()
endif()
if (SWIFT_COMPILER_VERSION)
if(${SWIFTLIB_SINGLE_SDK} IN_LIST SWIFT_APPLE_PLATFORMS)
list(APPEND SWIFTLIB_SINGLE_LINK_FLAGS "-Xlinker" "-current_version" "-Xlinker" "${SWIFT_COMPILER_VERSION}" "-Xlinker" "-compatibility_version" "-Xlinker" "1")
if(${SWIFTLIB_SINGLE_SDK} IN_LIST SWIFT_APPLE_PLATFORMS)
list(APPEND SWIFTLIB_SINGLE_LINK_FLAGS "-Xlinker" "-compatibility_version" "-Xlinker" "1")
if (SWIFT_COMPILER_VERSION)
list(APPEND SWIFTLIB_SINGLE_LINK_FLAGS "-Xlinker" "-current_version" "-Xlinker" "${SWIFT_COMPILER_VERSION}" )
endif()
endif()