Interop: support passing linker as arg to stub generator
This commit is contained in:
+1
-1
@@ -110,7 +110,7 @@ private fun processLib(ktGenRoot: String,
|
||||
val compilerOpts = config.getSpaceSeparated("compilerOpts") + additionalCompilerOpts
|
||||
val compiler = config.getProperty("compiler") ?: "clang"
|
||||
val linkerOpts = config.getSpaceSeparated("linkerOpts").toTypedArray() + additionalLinkerOpts
|
||||
val linker = config.getProperty("linker") ?: "clang"
|
||||
val linker = args["-linker"]?.singleOrNull() ?: config.getProperty("linker") ?: "clang"
|
||||
val excludedFunctions = config.getSpaceSeparated("excludedFunctions").toSet()
|
||||
|
||||
val fqParts = args["-pkg"]?.singleOrNull()?.let {
|
||||
|
||||
@@ -26,6 +26,7 @@ class NamedNativeInteropConfig extends AbstractFileCollection implements Named {
|
||||
|
||||
private List<String> compilerOpts = []
|
||||
private FileCollection headers;
|
||||
private String linker
|
||||
private List<String> linkerOpts = []
|
||||
private FileCollection linkFiles;
|
||||
private List<String> linkTasks = []
|
||||
@@ -48,6 +49,10 @@ class NamedNativeInteropConfig extends AbstractFileCollection implements Named {
|
||||
headers = headers + files
|
||||
}
|
||||
|
||||
void linker(String value) {
|
||||
linker = value
|
||||
}
|
||||
|
||||
void linkerOpts(String... values) {
|
||||
linkerOpts.addAll(values)
|
||||
}
|
||||
@@ -161,6 +166,10 @@ class NamedNativeInteropConfig extends AbstractFileCollection implements Named {
|
||||
args "-pkg:" + pkg
|
||||
}
|
||||
|
||||
if (linker != null) {
|
||||
args "-linker:" + linker
|
||||
}
|
||||
|
||||
args compilerOpts.collect { "-copt:$it" }
|
||||
args linkerOpts.collect { "-lopt:$it" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user