tirbofish/dropbear · commit
01c4c64ea374082640b4a1593d6a5b2539b57f48
ci: fixing build.gradle.kts for dokka docs
Signature present but could not be verified.
Unverified
@@ -33,7 +33,6 @@ val libPathProvider = provider { ) candidates.firstOrNull { it.exists() }?.absolutePath - ?: println("No Rust library exists") } kotlin { @@ -51,13 +50,33 @@ kotlin { } val nativeLibPath = libPathProvider.get() - val nativeLibDir = file(nativeLibPath).parentFile.absolutePath - val nativeLibFileName = file(nativeLibPath).name - val nativeLibNameForLinking = when { - isMacOs -> nativeLibFileName.removePrefix("lib").removeSuffix(".dylib") - isLinux -> nativeLibFileName.removePrefix("lib").removeSuffix(".so") - isMingwX64 -> nativeLibFileName.removeSuffix(".dll") - else -> throw GradleException("Unsupported OS for library name derivation.") + if (nativeLibPath != null) { + val nativeLibDir = file(nativeLibPath).parentFile.absolutePath + val nativeLibFileName = file(nativeLibPath).name + val nativeLibNameForLinking = when { + isMacOs -> nativeLibFileName.removePrefix("lib").removeSuffix(".dylib") + isLinux -> nativeLibFileName.removePrefix("lib").removeSuffix(".so") + isMingwX64 -> nativeLibFileName.removeSuffix(".dll") + else -> throw GradleException("Unsupported OS for library name derivation.") + } + + nativeTarget.apply { + binaries { + sharedLib { + baseName = "dropbear" + + if (isLinux || isMacOs) { + linkerOpts("-L$nativeLibDir", "-l$nativeLibNameForLinking", "-Wl,-rpath,\\\$ORIGIN") + } else if (isMingwX64) { + val importLibName = "$nativeLibNameForLinking.lib" + val importLibPath = file("$nativeLibDir/$importLibName").absolutePath + linkerOpts( + importLibPath + ) + } + } + } + }
Large diffs are not rendered by default. Showing the first 50 of 102 lines. Show full diff