Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports static linking for curl engine #3981

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/KotlinExtensions.kt
Expand Up @@ -19,11 +19,11 @@ val Project.kotlinter: KotlinterExtension get() = the()
fun KotlinMultiplatformExtension.createCInterop(
name: String,
cinteropTargets: List<String>,
block: DefaultCInteropSettings.() -> Unit
block: DefaultCInteropSettings.(String) -> Unit
) {
cinteropTargets.mapNotNull { targets.findByName(it) }.filterIsInstance<KotlinNativeTarget>().forEach {
val main by it.compilations
main.cinterops.create(name, block)
main.cinterops.create(name) { block(it.name) }
}
}

Expand Down
16 changes: 3 additions & 13 deletions ktor-client/ktor-client-curl/build.gradle.kts
Expand Up @@ -24,19 +24,9 @@ plugins {
kotlin {
if (fastTarget()) return@kotlin

createCInterop("libcurl", listOf("macosX64", "linuxX64", "mingwX64")) {
defFile = File(projectDir, "desktop/interop/libcurl.def")
includeDirs.headerFilterOnly(paths)
}

createCInterop("libcurl", listOf("macosArm64")) {
defFile = File(projectDir, "desktop/interop/libcurl_arm64.def")
includeDirs.headerFilterOnly(paths)
}

createCInterop("libcurl", listOf("linuxArm64")) {
defFile = File(projectDir, "desktop/interop/libcurl_linux_arm64.def")
includeDirs.headerFilterOnly(listOf("desktop/interop/linuxArm64/include/"))
createCInterop("libcurl", listOf("linuxX64", "linuxArm64", "macosX64", "macosArm64", "mingwX64")) { name ->
defFile = File(projectDir, "desktop/interop/$name/libcurl.def")
includeDirs.headerFilterOnly("desktop/interop/$name/include/")
}

sourceSets {
Expand Down
56 changes: 0 additions & 56 deletions ktor-client/ktor-client-curl/desktop/interop/libcurl.def

This file was deleted.

24 changes: 0 additions & 24 deletions ktor-client/ktor-client-curl/desktop/interop/libcurl_arm64.def

This file was deleted.

This file was deleted.