More changes to get intellij to reconize cinterop in native sourceset

This commit is contained in:
Ugljesa Jovanovic authored and Ugljesa Jovanovic committed 2020-06-07 17:18:41 +02:00
1 parent 9c9383d54f
commit 3a81d8e57c
7 files changed
+59 -245

No files matched your search

+19 -13
View File
@@ -17,9 +17,9 @@
@file:Suppress("UnstableApiUsage")
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin(PluginsDeps.multiplatform)
@@ -77,6 +77,15 @@ kotlin {
}
linuxX64() {
compilations.getByName("main") {
val libsodiumCinterop by cinterops.creating {
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-linux-x86-64/include/")
}
kotlinOptions.freeCompilerArgs = listOf(
"-include-binary", "${project.rootDir}/sodiumWrapper/static-linux-x86-64/lib/libsodium.a"
)
}
binaries {
staticLib {
}
@@ -314,18 +323,15 @@ kotlin {
compilations.getByName("main") {
if (linux64Bit.contains(this@withType.name)) {
defaultSourceSet.dependsOn(nativeMain)
compilations.getByName("main") {
val libsodiumCinterop by cinterops.creating {
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-linux-x86-64/include/")
}
kotlinOptions.freeCompilerArgs = listOf(
"-include-binary", "${project.rootDir}/sodiumWrapper/static-linux-x86-64/lib/libsodium.a"
)
}
}
if (linuxArm64Bit.contains(this@withType.name)) {
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
defaultSourceSet.dependsOn(
createWorkaroundNativeMainSourceSet(
this@withType.name,
nativeDependencies
)
)
compilations.getByName("main") {
val libsodiumCinterop by cinterops.creating {
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
@@ -440,13 +446,13 @@ kotlin {
}
val linuxX64Main by getting {
isRunningInIdea {
kotlin.srcDir("src/nativeMain")
kotlin.srcDir("src/nativeMain/kotlin")
}
}
val linuxX64Test by getting {
dependsOn(nativeTest)
isRunningInIdea {
kotlin.srcDir("src/nativeTest")
kotlin.srcDir("src/nativeTest/kotlin")
}
}
@@ -0,0 +1,9 @@
package com.ionspin.kotlin.crypto.hash.sha
/**
* Created by Ugljesa Jovanovic
* ugljesa.jovanovic@ionspin.com
* on 07-Jun-2020
*/
import platform.posix.*
//import cin
@@ -33,6 +33,7 @@ actual object Sha256StatelessDelegated : StatelessSha256 {
override fun digest(inputMessage: UByteArray): UByteArray {
val hashResult = UByteArray(Blake2bDelegatedStateless.MAX_HASH_BYTES)
val hashResultPinned = hashResult.pin()
// crypto_
TODO("not implemented yet")
}