File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 11// swift-tools-version:5.1
22import PackageDescription
3+ import class Foundation. ProcessInfo
34
4- let libraryType : PackageDescription . Product . Library . LibraryType = . static
5+ // force building as dynamic library
6+ let dynamicLibrary = ProcessInfo . processInfo. environment [ " SWIFT_BUILD_DYNAMIC_LIBRARY " ] != nil
7+ let libraryType : PackageDescription . Product . Library . LibraryType ? = dynamicLibrary ? . dynamic : nil
58
6- let package = Package (
9+ var package = Package (
710 name: " TLVCoding " ,
811 products: [
912 . library(
@@ -13,7 +16,23 @@ let package = Package(
1316 )
1417 ] ,
1518 targets: [
16- . target( name: " TLVCoding " , path: " ./Sources " ) ,
17- . testTarget( name: " TLVCodingTests " , dependencies: [ " TLVCoding " ] )
19+ . target(
20+ name: " TLVCoding " ,
21+ path: " ./Sources "
22+ ) ,
23+ . testTarget(
24+ name: " TLVCodingTests " ,
25+ dependencies: [ " TLVCoding " ]
26+ )
1827 ]
1928)
29+
30+ // SwiftPM command plugins are only supported by Swift version 5.6 and later.
31+ #if swift(>=5.6)
32+ let buildDocs = ProcessInfo . processInfo. environment [ " BUILDING_FOR_DOCUMENTATION_GENERATION " ] != nil
33+ if buildDocs {
34+ package . dependencies += [
35+ . package ( url: " https://github.com/apple/swift-docc-plugin " , from: " 1.0.0 " ) ,
36+ ]
37+ }
38+ #endif
You can’t perform that action at this time.
0 commit comments