浏览代码

Fix for warning: "Linking against a dylib which is not safe for use in application extensions"

Patryk Grabowski 2 年之前
父节点
当前提交
84bb98c5dc
共有 3 个文件被更改,包括 17 次插入2 次删除
  1. 7 0
      .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
  2. 4 1
      Package.swift
  3. 6 1
      Package@swift-5.3.swift

+ 7 - 0
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:">
+   </FileRef>
+</Workspace>

+ 4 - 1
Package.swift

@@ -18,6 +18,9 @@ let package = Package(
         .library(name: "KeychainAccess", targets: ["KeychainAccess"])
     ],
     targets: [
-        .target(name: "KeychainAccess", path: "Lib/KeychainAccess")
+        .target(
+          name: "KeychainAccess",
+          path: "Lib/KeychainAccess",
+          linkerSettings: [.unsafeFlags(["-Xlinker", "-no_application_extension"])])
     ]
 )

+ 6 - 1
Package@swift-5.3.swift

@@ -18,6 +18,11 @@ let package = Package(
         .library(name: "KeychainAccess", targets: ["KeychainAccess"])
     ],
     targets: [
-        .target(name: "KeychainAccess", path: "Lib/KeychainAccess", exclude:["Info.plist"])
+        .target(
+          name: "KeychainAccess",
+          path: "Lib/KeychainAccess",
+          exclude: ["Info.plist"],
+          linkerSettings: [.unsafeFlags(["-Xlinker", "-no_application_extension"])]
+        )
     ]
 )