Revert "Rework cinterop linkerOpts/compilerOpts (KT-29970) (#2805)"
This reverts commit df14d401e8.
This commit is contained in:
+3
-3
@@ -98,14 +98,14 @@ open class CInteropTask @Inject constructor(val settings: CInteropSettingsImpl):
|
||||
addFileArgs("-header", headers)
|
||||
|
||||
compilerOpts.forEach {
|
||||
addArg("-compilerOpt", it)
|
||||
addArg("-copt", it)
|
||||
}
|
||||
|
||||
linkerOpts.forEach {
|
||||
addArg("-linkerOpt", it)
|
||||
addArg("-lopt", it)
|
||||
}
|
||||
|
||||
addArgs("-compilerOpt", allHeadersDirs.map { "-I${it.absolutePath}" })
|
||||
addArgs("-copt", allHeadersDirs.map { "-I${it.absolutePath}" })
|
||||
addArgs("-headerFilterAdditionalSearchPrefix", headerFilterDirs.map { it.absolutePath })
|
||||
|
||||
libraries.files.filter {
|
||||
|
||||
+1
-3
@@ -196,9 +196,7 @@ open class KotlinNativeCompile @Inject constructor(internal val binary: Abstract
|
||||
else -> { /* Do nothing. */ }
|
||||
}
|
||||
|
||||
linkerOpts.forEach {
|
||||
addArg("-linker-option", it)
|
||||
}
|
||||
addListArg("-linker-options", linkerOpts)
|
||||
|
||||
addAll(sources.files.map { it.absolutePath })
|
||||
commonSources.files.mapTo(this) { "-Xcommon-sources=${it.absolutePath}" }
|
||||
|
||||
+6
@@ -203,6 +203,12 @@ internal fun MutableList<String>.addFileArgs(parameter: String, values: Collecti
|
||||
}
|
||||
}
|
||||
|
||||
internal fun MutableList<String>.addListArg(parameter: String, values: List<String>) {
|
||||
if (values.isNotEmpty()) {
|
||||
addArg(parameter, values.joinToString(separator = " "))
|
||||
}
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
internal fun dumpProperties(task: Task) {
|
||||
|
||||
+2
-3
@@ -122,9 +122,8 @@ abstract class KonanCompileTask: KonanBuildingTask(), KonanCompileSpec {
|
||||
|
||||
addFileArgs("-native-library", nativeLibraries)
|
||||
addArg("-produce", produce.name.toLowerCase())
|
||||
linkerOpts.forEach {
|
||||
addArg("-linker-option", it)
|
||||
}
|
||||
|
||||
addListArg("-linker-options", linkerOpts)
|
||||
|
||||
addArgIfNotNull("-target", konanTarget.visibleName)
|
||||
addArgIfNotNull("-language-version", languageVersion)
|
||||
|
||||
+2
-2
@@ -93,10 +93,10 @@ open class KonanInteropTask @Inject constructor(val workerExecutor: WorkerExecut
|
||||
linkerOpts.addAll(it.files.map { it.canonicalPath })
|
||||
}
|
||||
linkerOpts.forEach {
|
||||
addArg("-linkerOpt", it)
|
||||
addArg("-lopt", it)
|
||||
}
|
||||
|
||||
addArgs("-compilerOpt", includeDirs.allHeadersDirs.map { "-I${it.absolutePath}" })
|
||||
addArgs("-copt", includeDirs.allHeadersDirs.map { "-I${it.absolutePath}" })
|
||||
addArgs("-headerFilterAdditionalSearchPrefix", includeDirs.headerFilterDirs.map { it.absolutePath })
|
||||
|
||||
addArgs("-repo", libraries.repos.map { it.canonicalPath })
|
||||
|
||||
Reference in New Issue
Block a user