Skip to content

Commit

Permalink
Fix linker options
Browse files Browse the repository at this point in the history
  • Loading branch information
hfhbd committed Dec 29, 2022
1 parent 5cdb34d commit f84a78a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
28 changes: 14 additions & 14 deletions drivers/native-driver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kotlin {
sourceSets {
commonMain {
dependencies {
api project (':runtime')
api project(':runtime')
}
}
commonTest {
Expand All @@ -54,52 +54,52 @@ kotlin {
nativeLinuxLikeMain {
dependsOn(nativeMain)
}
nativeDarwinMain{
nativeDarwinMain {
dependsOn(nativeLinuxLikeMain)
}
mingwMain{
mingwMain {
dependsOn(nativeMain)
}
mingwX86Main{
mingwX86Main {
dependsOn(mingwMain)
}
mingwX64Main{
mingwX64Main {
dependsOn(mingwMain)
}
linuxMain{
linuxMain {
dependsOn(nativeLinuxLikeMain)
}
}

configure([targets.iosX64, targets.iosArm32, targets.iosArm64, targets.tvosX64, targets.tvosArm64, targets.watchosX86, targets.watchosX64, targets.watchosArm32, targets.watchosArm64, targets.macosX64, targets.macosArm64, targets.iosSimulatorArm64, targets.watchosSimulatorArm64, targets.tvosSimulatorArm64]) {
sourceSets.getByName("${name}Main").dependsOn(sourceSets.nativeDarwinMain)
sourceSets.getByName("${name}Test").dependsOn(sourceSets.nativeTest)
compilations.test {
kotlinOptions.freeCompilerArgs += ["-linker-options", "-lsqlite3"]
binaries.configureEach {
freeCompilerArgs += ["-linker-options", "-lsqlite3"]
}
}

configure([targets.linuxX64]) {
sourceSets.getByName("${name}Main").dependsOn(sourceSets.linuxMain)
sourceSets.getByName("${name}Test").dependsOn(sourceSets.nativeTest)
compilations.test {
kotlinOptions.freeCompilerArgs += ["-linker-options", "-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib -L/usr/lib64"]
binaries.configureEach {
freeCompilerArgs += ["-linker-options", "-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib -L/usr/lib64"]
}
}

configure([targets.mingwX64]) {
sourceSets.getByName("${name}Main").dependsOn(sourceSets.mingwMain)
sourceSets.getByName("${name}Test").dependsOn(sourceSets.nativeTest)
compilations.test {
kotlinOptions.freeCompilerArgs += ["-linker-options", "-Lc:\\msys64\\mingw64\\lib -L$rootDir\\libs -lsqlite3".toString()]
binaries.configureEach {
freeCompilerArgs += ["-linker-options", "-Lc:\\msys64\\mingw64\\lib -L$rootDir\\libs -lsqlite3".toString()]
}
}

configure([targets.mingwX86]) {
sourceSets.getByName("${name}Main").dependsOn(sourceSets.mingwMain)
sourceSets.getByName("${name}Test").dependsOn(sourceSets.nativeTest)
compilations.test {
kotlinOptions.freeCompilerArgs += ["-linker-options", "-Lc:\\msys32\\mingw32\\lib -L$rootDir\\libs -lsqlite3".toString()]
binaries.configureEach {
freeCompilerArgs += ["-linker-options", "-Lc:\\msys32\\mingw32\\lib -L$rootDir\\libs -lsqlite3".toString()]
}
}

Expand Down
8 changes: 2 additions & 6 deletions extensions/androidx-paging3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,10 @@ kotlin {
}

configure([targets.iosX64, targets.iosArm64]) {
compilations.test {
kotlinOptions.freeCompilerArgs += ['-linker-options', '-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib -L/usr/lib64']
binaries.configureEach {
freeCompilerArgs += ['-linker-options', '-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib -L/usr/lib64']
}
}
}

tasks.withType(org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest) {
deviceId = "iPhone 14"
}

apply from: "$rootDir/gradle/gradle-mvn-push.gradle"
8 changes: 4 additions & 4 deletions extensions/coroutines-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ kotlin {
}

configure([targets.iosX64, targets.iosArm32, targets.iosArm64, targets.tvosX64, targets.tvosArm64, targets.watchosX86, targets.watchosX64, targets.watchosArm32, targets.watchosArm64, targets.macosX64, targets.linuxX64, targets.macosArm64, targets.iosSimulatorArm64, targets.watchosSimulatorArm64, targets.tvosSimulatorArm64]) {
compilations.test {
kotlinOptions.freeCompilerArgs += ['-linker-options', '-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib -L/usr/lib64']
binaries.configureEach {
freeCompilerArgs += ['-linker-options', '-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib -L/usr/lib64']
}
}

// mingwX86 target is not supported by kotlinx.coroutines, see https://github.com/Kotlin/kotlinx.coroutines/issues/2157
configure([targets.mingwX64]) {
compilations.test {
kotlinOptions.freeCompilerArgs += ["-linker-options", "-Lc:\\msys64\\mingw64\\lib -L$rootDir\\libs -lsqlite3".toString()]
binaries.configureEach {
freeCompilerArgs += ["-linker-options", "-Lc:\\msys64\\mingw64\\lib -L$rootDir\\libs -lsqlite3".toString()]
}
}

Expand Down

0 comments on commit f84a78a

Please sign in to comment.