Update libsodium build to latest upstream with tvos modification
This commit is contained in:
1 parent
8b3baaba81
commit
065abe1dab
8 files changed
+125
-44
No files matched your search
@@ -301,22 +301,28 @@ kotlin {
|
||||
val macos64Bit = setOf(
|
||||
"macosX64"
|
||||
)
|
||||
val ios64Bit = setOf(
|
||||
"iosArm64", "iosX64"
|
||||
val iosArm = setOf(
|
||||
"iosArm64", "iosArm32"
|
||||
)
|
||||
val ios32Bit = setOf(
|
||||
"iosArm32"
|
||||
val iosSimulator = setOf(
|
||||
"iosX64"
|
||||
)
|
||||
val mingw64Bit = setOf(
|
||||
"mingwX64"
|
||||
)
|
||||
|
||||
val tvos64Bit = setOf(
|
||||
"tvosArm64", "tvosX64"
|
||||
val tvosArm = setOf(
|
||||
"tvosArm64"
|
||||
)
|
||||
val tvosSimulator = setOf(
|
||||
"tvosX64"
|
||||
)
|
||||
|
||||
val watchos32Bit = setOf(
|
||||
"watchosX86", "watchosArm32", "watchosArm64"
|
||||
val watchosArm = setOf(
|
||||
"watchosArm32", "watchosArm64"
|
||||
)
|
||||
val watchosSimulator = setOf(
|
||||
"watchosX86"
|
||||
)
|
||||
|
||||
targets.withType<KotlinNativeTarget> {
|
||||
@@ -327,12 +333,12 @@ kotlin {
|
||||
defaultSourceSet.dependsOn(nativeMain)
|
||||
}
|
||||
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 {
|
||||
@@ -351,7 +357,7 @@ kotlin {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
}
|
||||
//All ioses share the same static library
|
||||
if (ios64Bit.contains(this@withType.name)) {
|
||||
if (iosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@@ -363,19 +369,19 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (ios32Bit.contains(this@withType.name)) {
|
||||
if (iosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-ios/include")
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-ios-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-ios/lib/libsodium.a"
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-ios-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
if (tvos64Bit.contains(this@withType.name)) {
|
||||
if (tvosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@@ -387,7 +393,19 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (watchos32Bit.contains(this@withType.name)) {
|
||||
if (tvosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-tvos-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-tvos-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
if (watchosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@@ -399,6 +417,18 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (watchosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-watchos-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-watchos-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user