[SR-6805] generate-xcodeproj
does not honor library type: .static
#4900
Labels
generate-xcodeproj
does not honor library type: .static
#4900
Attachment: Download
Environment
Xcode Version 9.2 (9C40b)
Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Apple Swift Package Manager - Swift 4.0.0-dev (swiftpm-13752)
Additional Detail from JIRA
md5: eca9f978ea38aeefedb1abc9ce116c45
Issue Description:
When a library is expressly declared `type: .static` in the library's Package.swift manifest, then it seems that one should reasonably expect `swift package generate-xcodeproj` to generate an Xcode project which preserves the library as static through out the build process.
Example
The following two Swift Manager Packages (SPM) packages are both attached to this issue and also available on GitHub:
Static Library Depedency: `TinkerEvalStaticLib` (https://github.com/VaporExamplesLab/TinkerEvalStaticLib) used `swift package init --type library` as the starting point.
Command Line Executable: `TinkerEvalStaticCli` (https://github.com/VaporExamplesLab/TinkerEvalStaticCli) used `swift package init --type executable` as the starting point.
`TinkerEvalStaticLib` has one simple function and is expressly set to a type `.static` in Package.swift.
TinkerEvalStaticLib.swift
Package.swift
`TinkerEvalStaticCli` is also simple and has the static library `TinkerEvalStaticLib` as a dependency.
main.swift
Package.swift
Observation
1. In the `TinkerEvalStaticCli` directory, `swift build` will create a standalone relocatable, statically linked executable.
2. However, the Xcode project created with `swift package generate-xcodeproj` creates a dynamically linked executable that requires the separate library.
The text was updated successfully, but these errors were encountered: