File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
plugin/src/main/kotlin/io/github/ttypic/swiftklib/gradle/task Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,12 @@ open class CompileSwiftTask @Inject constructor(
102
102
project.exec {
103
103
it.executable = " xcrun"
104
104
it.workingDir = swiftBuildDir
105
- it.args = generateBuildArgs()
105
+ val extraArgs = if (compileTarget == CompileTarget .iosArm64) {
106
+ additionalSysrootArgs()
107
+ } else {
108
+ emptyList()
109
+ }
110
+ it.args = generateBuildArgs() + extraArgs
106
111
}
107
112
108
113
return SwiftBuildResult (
@@ -134,6 +139,14 @@ open class CompileSwiftTask @Inject constructor(
134
139
" ${compileTarget.archPrefix()} -apple-${operatingSystem(compileTarget)} .0${compileTarget.simulatorSuffix()} " ,
135
140
)
136
141
142
+ /* * Workaround for bug in toolchain where the sdk path (via `swiftc -sdk` flag) is not propagated to clang. */
143
+ private fun additionalSysrootArgs (): List <String > = listOf (
144
+ " -Xcc" ,
145
+ " -isysroot" ,
146
+ " -Xcc" ,
147
+ readSdkPath(),
148
+ )
149
+
137
150
private fun readSdkPath (): String {
138
151
val stdout = ByteArrayOutputStream ()
139
152
You can’t perform that action at this time.
0 commit comments