Adding libsodium

This commit is contained in:
Ugljesa Jovanovic authored and Ugljesa Jovanovic committed 2020-05-24 17:24:32 +02:00
1 parent 7238b09112
commit 3f7df6c651
6 files changed
+49 -130

No files matched your search

@@ -89,6 +89,11 @@ kotlin {
}
linuxX64("linux") {
compilations.getByName("main") {
val libsodiumCinterop by cinterops.creating {
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
}
}
binaries {
staticLib {
optimized = true
@@ -383,14 +388,14 @@ tasks {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true
showStandardStreams = true
}
}
val jsNodeTest by getting(KotlinJsTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
showStandardStreams = true
// showStandardStreams = true
}
}
@@ -479,4 +484,18 @@ publishing {
}
}
//configurations.forEach {
//
// if (it.name == "linuxCompileKlibraries") {
// println("Configuration name: ${it.name}")
// it.attributes {
// this.keySet().forEach { key ->
// val attribute = getAttribute(key)
// println(" |-- Attribute $key ${attribute}")
// attribute(org.jetbrains.kotlin.gradle.plugin.ProjectLocalConfigurations.ATTRIBUTE, "publicZ")
// }
// }
// }
//}
@@ -1,5 +1,6 @@
package com.ionspin.kotlin.crypto.hash.blake2b
import interop.*
import kotlinx.cinterop.*
/**
* Created by Ugljesa Jovanovic
* ugljesa.jovanovic@ionspin.com
@@ -0,0 +1,23 @@
package com.ionspin.kotlin.crypto.hash.blake2b
/**
* Created by Ugljesa Jovanovic
* ugljesa.jovanovic@ionspin.com
* on 24-May-2020
*/
import interop.*
import kotlinx.cinterop.*
import libsodium.*
import kotlin.test.Test
class Blake2bLinuxTest {
@Test
fun testCinterop() {
val sodiumInitResult = sodium_init()
// println("Sodium init $sodiumInitResult")
println("1")
}
}
@@ -1,6 +1,6 @@
headers = sodium.h
headerFilter = sodium.h sodium/**
staticLibraries = libsodium.a
libraryPaths = lib
compilerOpts = -Iinclude
linkerOpts = {{LDFLAGS}}
libraryPaths = /usr/lib
compilerOpts = -Iinclude -I/usr/include
linkerOpts = -L/usr/lib -lsodium