Unverified Commit ba25a5c5 authored by Nikolay Igotti's avatar Nikolay Igotti Committed by GitHub

Only create objcCompile task on macOS, fails on Windows in IDE (#360)

parent fe6bf4af
...@@ -711,9 +711,10 @@ val linkJvmBindings = tasks.register<LinkSkikoTask>("linkJvmBindings") { ...@@ -711,9 +711,10 @@ val linkJvmBindings = tasks.register<LinkSkikoTask>("linkJvmBindings") {
flags.set(listOf(*osFlags)) flags.set(listOf(*osFlags))
} }
// Very hacky way to compile Objective-C sources and add the if (hostOs == OS.MacOS) {
// resulting object files into the final library. // Very hacky way to compile Objective-C sources and add the
project.tasks.register<Exec>("objcCompile") { // resulting object files into the final library.
project.tasks.register<Exec>("objcCompile") {
val inputDir = "$projectDir/src/jvmMain/objectiveC/${targetOs.id}" val inputDir = "$projectDir/src/jvmMain/objectiveC/${targetOs.id}"
val outDir = "$buildDir/objc/$target" val outDir = "$buildDir/objc/$target"
val names = File(inputDir).listFiles()!!.map { it.name.removeSuffix(".mm") } val names = File(inputDir).listFiles()!!.map { it.name.removeSuffix(".mm") }
...@@ -738,6 +739,7 @@ project.tasks.register<Exec>("objcCompile") { ...@@ -738,6 +739,7 @@ project.tasks.register<Exec>("objcCompile") {
file(outDir).mkdirs() file(outDir).mkdirs()
inputs.files(srcs) inputs.files(srcs)
outputs.files(outs) outputs.files(outs)
}
} }
val generateVersion = project.tasks.register("generateVersion") { val generateVersion = project.tasks.register("generateVersion") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment