Linker flag specified in Package.swift as unsafe flag is passed to main app target.
steps:
create empty package and add linkerSettings: [.unsafeFlags(["-Wl,-make_mergeable"])] to target
import PackageDescription
let package = Package(
name: "TestPackage",
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "TestPackage",
type: .dynamic,
targets: ["TestPackage"]),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "TestPackage",
linkerSettings: [.unsafeFlags(["-Wl,-make_mergeable"])]
),
.testTarget(
name: "TestPackageTests",
dependencies: ["TestPackage"]),
]
)
create empty Xcode iOS app project and add package to project via Add Files
3 add package as a framework dependency to the main app
in the result, build fails with error:
ld: -make_mergeable can only be used when creating a dynamic library
package itself builds with -mergable_library and that is fine