/
build.gradle
50 lines (48 loc) · 1.63 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
plugins {
id 'kotlin-multiplatform' version '1.3.0'
}
repositories {
mavenCentral()
}
kotlin {
targets {
// For ARM, preset should be changed to presets.iosArm32 or presets.iosArm64
// For Linux, preset should be changed to e.g. presets.linuxX64
// For MacOS, preset should be changed to e.g. presets.macosX64
fromPreset(presets.linuxX64, 'linux') {
compilations.main {
cinterops {
lwan {
defFile = file('src/linuxMain/lwan.def')
}
}
linkerOpts "-Wl,-rpath ${new File(".").absolutePath}/lwan/build/src/lib"
}
}
configure([linux]) {
// Comment to generate Kotlin/Native library (KLIB) instead of executable file:
compilations.main.outputKinds([EXECUTABLE])
// Change to specify fully qualified name of your application's entry point:
compilations.main.entryPoint = 'kwang.main'
}
}
sourceSets {
// Note: To enable common source sets please comment out 'kotlin.import.noCommonSourceSets' property
// in gradle.properties file and re-import your project in IDE.
linuxMain {
}
linuxTest {
}
}
}
task runProgram {
def buildType = 'release' // Change to 'debug' to run application with debug symbols.
dependsOn "link${buildType.capitalize()}ExecutableLinux"
doLast {
def programFile = kotlin.targets.linux.compilations.main.getBinary('EXECUTABLE', buildType)
exec {
executable programFile
args ''
}
}
}