|
1 | | -import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension |
2 | | -import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget |
3 | 1 | import org.jetbrains.kotlin.konan.target.HostManager |
4 | 2 |
|
5 | 3 | plugins { |
@@ -32,30 +30,29 @@ fun configInterop(target: org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTar |
32 | 30 |
|
33 | 31 | kotlin { |
34 | 32 | val knTargets = listOf( |
35 | | - macosX64(), |
36 | | - iosX64(), |
37 | | - iosArm64(), |
38 | | - iosArm32(), |
39 | | - watchosArm32(), |
40 | | - watchosArm64(), |
41 | | - watchosX86(), |
42 | | - watchosX64(),tvosArm64(), |
43 | | - tvosX64(), |
44 | | - mingwX64("mingw") { |
45 | | - compilations.forEach { |
46 | | - it.kotlinOptions.freeCompilerArgs += listOf("-linker-options", "-Lc:\\msys64\\mingw64\\lib") |
47 | | - } |
48 | | - }, |
49 | | - linuxX64 { |
50 | | - compilations.forEach { |
51 | | - it.kotlinOptions.freeCompilerArgs += listOf( |
52 | | - "-linker-options", |
53 | | - "-lsqlite3 -L/usr/lib/x86_64-linux-gnu" //just /usr/lib for arch |
54 | | - ) |
55 | | - } |
| 33 | + macosX64(), |
| 34 | + iosX64(), |
| 35 | + iosArm64(), |
| 36 | + iosArm32(), |
| 37 | + watchosArm32(), |
| 38 | + watchosArm64(), |
| 39 | + watchosX86(), |
| 40 | + watchosX64(),tvosArm64(), |
| 41 | + tvosX64(), |
| 42 | + mingwX64("mingw") { |
| 43 | + compilations.forEach { |
| 44 | + it.kotlinOptions.freeCompilerArgs += listOf("-linker-options", "-Lc:\\msys64\\mingw64\\lib") |
56 | 45 | } |
57 | | - ) |
58 | | - } |
| 46 | + }, |
| 47 | + linuxX64 { |
| 48 | + compilations.forEach { |
| 49 | + it.kotlinOptions.freeCompilerArgs += listOf( |
| 50 | + "-linker-options", |
| 51 | + "-lsqlite3 -L/usr/lib/x86_64-linux-gnu" //just /usr/lib for arch |
| 52 | + ) |
| 53 | + } |
| 54 | + } |
| 55 | + ) |
59 | 56 |
|
60 | 57 | knTargets |
61 | 58 | .forEach { target -> |
@@ -86,24 +83,24 @@ kotlin { |
86 | 83 | } |
87 | 84 |
|
88 | 85 |
|
89 | | - val mingwMain = sourceSets.maybeCreate("mingwMain").apply { |
90 | | - dependsOn(nativeCommonMain) |
91 | | - } |
92 | | - knTargets.forEach { target -> |
93 | | - when { |
94 | | - target.name.startsWith("mingw") -> { |
95 | | - target.compilations.getByName("main").source(mingwMain) |
96 | | - target.compilations.getByName("test").source(nativeCommonTest) |
97 | | - } |
98 | | - target.name.startsWith("linux") -> { |
99 | | - target.compilations.getByName("main").source(linuxMain) |
100 | | - target.compilations.getByName("test").source(nativeCommonTest) |
101 | | - } |
102 | | - else -> { |
103 | | - target.compilations.getByName("main").source(appleMain) |
104 | | - target.compilations.getByName("test").source(nativeCommonTest) |
105 | | - } |
| 86 | + val mingwMain = sourceSets.maybeCreate("mingwMain").apply { |
| 87 | + dependsOn(nativeCommonMain) |
| 88 | + } |
| 89 | + knTargets.forEach { target -> |
| 90 | + when { |
| 91 | + target.name.startsWith("mingw") -> { |
| 92 | + target.compilations.getByName("main").source(mingwMain) |
| 93 | + target.compilations.getByName("test").source(nativeCommonTest) |
| 94 | + } |
| 95 | + target.name.startsWith("linux") -> { |
| 96 | + target.compilations.getByName("main").source(linuxMain) |
| 97 | + target.compilations.getByName("test").source(nativeCommonTest) |
106 | 98 | } |
| 99 | + else -> { |
| 100 | + target.compilations.getByName("main").source(appleMain) |
| 101 | + target.compilations.getByName("test").source(nativeCommonTest) |
| 102 | + } |
| 103 | + } |
107 | 104 |
|
108 | 105 | } |
109 | 106 | } |
|
0 commit comments