giginet / Scipio

A new build tool to generate XCFramework

Home Page:https://giginet.github.io/Scipio/documentation/scipio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resolve undefined symbols error of dynamic xcframework

yshrkt opened this issue · comments

I've been trying to build dynamic xcframework from library which has some dependencies like this:

let runner = Runner(
    mode: .prepareDependencies,
    options: .init(
        baseBuildOptions: .init(
            buildConfiguration: .release,
            isSimulatorSupported: true,
            isDebugSymbolsEmbedded: true,
            frameworkType: .dynamic,
            extraBuildParameters: [
                "FRAMEWORK_SEARCH_PATHS[__platform_filter=ios]": "$(inherited) \(scipioDirectory.appending(path: ".build/scipio/DerivedData/Products/Release-iphoneos").path())",
                "FRAMEWORK_SEARCH_PATHS[__platform_filter=ios-simulator]": "$(inherited) \(scipioDirectory.appending(path: ".build/scipio/DerivedData/Products/Release-iphonesimulator").path())"
            ],
            enableLibraryEvolution: false
        ),
        buildOptionsMatrix: [
            "NIOConcurrencyHelpers": .init(
                extraFlags: .init(linkerFlags: [
                    "-framework CNIOAtomics"
                ])
            ),
            "Atomics": .init(
                extraFlags: .init(linkerFlags: [
                    "-framework _AtomicsShims"
                ])
            ),
            ...
        ],
        shouldOnlyUseVersionsFromResolvedFile: true,
        cacheMode: .project,
        overwrite: true,
        verbose: false
    )
)

It seems to work fine, but is this the right solution for undefined symbol errors?
Also, I think it's hard to configure all the dependencies manually.
So it would be nice if Scipio could automatically configure these settings according to the target dependencies.