# How can I determine the Swift compiler version used to create a Framework?

**URL:** <https://forums.swift.org/t/how-can-i-determine-the-swift-compiler-version-used-to-create-a-framework/45039>\
**Category:** Using Swift\
**Tags:** macos\
**Created:** [February 23, 2021, 9:04pm UTC](https://forums.swift.org/t/how-can-i-determine-the-swift-compiler-version-used-to-create-a-framework/45039 "2021-02-23T21:04:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukzett](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@lukzett](https://forums.swift.org/u/lukzett)\
**Post date:** [February 23, 2021, 9:04pm UTC](https://forums.swift.org/t/how-can-i-determine-the-swift-compiler-version-used-to-create-a-framework/45039/1 "2021-02-23T21:04:54Z")

</div>

So I have a compiled library (Mac os) and I want to know what compiler version was used exactly. In my example I tried the following:

```swift
otool -L TestFramework 
TestFramework:
	@rpath/TestFramework.framework/Versions/A/TestFramework (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1675.129.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
	@rpath/libswiftCore.dylib (compatibility version 1.0.0, current version 1103.8.25)

```

It looks like `1103.8.25` could be useful, but when I look the version up (on Wikipedia) it doesn't help, as the versions there look like this:

```swift
5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1),
5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8),
5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
etc..

```

It looks like that my `1103.8.25` might hint to one of these:

```swift
5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29),
5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51),
5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53),
5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53),
5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)

```

, because of the `1103` but which one is it?

(I can ask Xcode but I want to know how Xcode knows..)

---

<div class="post-metadata">

**Author:** ![eskimo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/eskimo/32/13558_2.png) [@eskimo](https://forums.swift.org/u/eskimo)\
**Post date:** [February 24, 2021, 10:02am UTC](https://forums.swift.org/t/how-can-i-determine-the-swift-compiler-version-used-to-create-a-framework/45039/2 "2021-02-24T10:02:43Z")

</div>

> So I have a compiled library (Mac os) and I want to know what compiler  
> version was used exactly.

Was your library compiled in ABI stable mode? That is, with Build Libraries for Distribution (`BUILD_LIBRARY_FOR_DISTRIBUTION`) set? If so, the `.swiftinterface` file contains the info you need:

```swift
// swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)

```

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

---

<div class="post-metadata">

**Author:** ![lukzett](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@lukzett](https://forums.swift.org/u/lukzett)\
**Post date:** [February 24, 2021, 10:51am UTC](https://forums.swift.org/t/how-can-i-determine-the-swift-compiler-version-used-to-create-a-framework/45039/3 "2021-02-24T10:51:50Z")

</div>

Thank you eskimo. Unfortunately it really matters for me to get that information when it's not built with ABI stable mode, otherwise things are simpler.

How does Xcode do it? Surely they must be looking at the required library versions.. is there a list somewhere of them? So we can derive a swift language version from, for example, libswiftCore.dylib's version?
