[K/N] Fix FrameworkTest in case of simulator target
As of Xcode 13.1 Swift 5.5 passes wrong libclang_rt to simulator targets (similar to ours KT-47333). To workaround this problem, we explicitly provide the correct one.
This commit is contained in:
@@ -169,7 +169,16 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable {
|
|||||||
"-F", frameworkParentDirPath,
|
"-F", frameworkParentDirPath,
|
||||||
"-Xcc", "-Werror" // To fail compilation on warnings in framework header.
|
"-Xcc", "-Werror" // To fail compilation on warnings in framework header.
|
||||||
)
|
)
|
||||||
compileSwift(project, project.testTarget, sources, options + swiftExtraOpts, Paths.get(executable), fullBitcode)
|
// As of Xcode 13.1 swift passes wrong libclang_rt to simulator targets (similar to KT-47333).
|
||||||
|
// To workaround this problem, we explicitly provide the correct one.
|
||||||
|
val simulatorHack = if (project.testTargetConfigurables.targetTriple.isSimulator) {
|
||||||
|
project.platformManager.platform(project.testTarget).linker.provideCompilerRtLibrary("")?.let {
|
||||||
|
listOf("-Xlinker", it)
|
||||||
|
} ?: emptyList()
|
||||||
|
} else {
|
||||||
|
emptyList()
|
||||||
|
}
|
||||||
|
compileSwift(project, project.testTarget, sources, options + simulatorHack + swiftExtraOpts, Paths.get(executable), fullBitcode)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ abstract class LinkerFlags(val configurables: Configurables) {
|
|||||||
return libraries
|
return libraries
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun provideCompilerRtLibrary(libraryName: String, isDynamic: Boolean = false): String? {
|
open fun provideCompilerRtLibrary(libraryName: String, isDynamic: Boolean = false): String? {
|
||||||
System.err.println("Can't provide $libraryName.")
|
System.err.println("Can't provide $libraryName.")
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user