Skolson5903
08/31/2020, 5:44 PMmingwX64 {
compilations.getByName("main") {
val myInterop by cinterops.creating {
defFile("some.def")
packageName("com.whatever")
compilerOpts("-I$someIncludePath")
//... whatever else ...
}
}
}
and a nativeMain sourceset that needs to depend on the output from the mingw64 main compilation cinterop library it generates, what's the best way to specify that dependency? The sourceset name for the above compilation is "mingwX64Main", so I tried this:
val mingwX64Main by getting
val nativeMain by getting {
dependsOn(mingwX64Main)
}
but no luck. There's no explicit source in that sourceset, just the generated external library from cinterop, which dependsOn doesn't see. The only way I've gotten nativeMain source to see the stuff generated by cinterop is by adding this to the compilation:
defaultSourceSet {
kotlin.srcDir("src/nativeMain/kotlin")
}
which points the mingwX64Main sourceset to the same source directory as nativeMain. This allows imports etc to work in
nativeMain source. But it seems kludgy as it gets a gradle warning on every sync:
Duplicate content roots detected: (text about nativeMain and mingwX64Main sourcesets overlapping)
Seems like there should be a dependsOn or a dependencies clause to explicitly declare this. Anybody got suggestions?
Something like:
val nativeMain by getting {
dependencies {
implementation(<ref to the cinterop library produced from compilation mingwX64 main, sourceset mingwX64Main>)
}
}
Or any other way that doesn't get warnings on every sync :-) Thanks in advance for any help...Kris Wong
08/31/2020, 5:52 PMSkolson5903
08/31/2020, 6:09 PMKris Wong
08/31/2020, 6:10 PMSkolson5903
08/31/2020, 6:11 PMKris Wong
08/31/2020, 6:12 PMSkolson5903
08/31/2020, 6:17 PM