-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
63 lines (53 loc) · 1.68 KB
/
build.gradle
File metadata and controls
63 lines (53 loc) · 1.68 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
plugins {
id 'kotlin-multiplatform' version '1.3.21'
}
repositories {
mavenCentral()
}
def hostPreset = determinePreset()
kotlin {
targets {
fromPreset(hostPreset, 'linux')
configure([linux]) {
compilations.main.cinterops {
libpahomqtt {
switch (hostPreset) {
case presets.linuxX64:
includeDirs.headerFilterOnly '/usr/local/include', '/usr/local/lib'
break
case presets.linuxArm32Hfp:
includeDirs.headerFilterOnly '/usr/local/include', '/var/eabi-chroot/usr/local/lib'
break
}
}
}
compilations.main.outputKinds('EXECUTABLE')
compilations.main.entryPoint = 'org.udoo.iot.simpsonhouse.main'
}
}
sourceSets {
linuxMain {
dependencies {
// implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.0.1'
}
}
}
}
private def determinePreset() {
def preset = kotlin.presets.linuxX64
if (project.hasProperty('buildType') && project.buildType == "arm") {
preset = kotlin.presets.linuxArm32Hfp
}
preset
}
task runProgram {
def buildType = 'RELEASE' // Change to 'DEBUG' to run application with debug symbols.
dependsOn kotlin.targets.linux.compilations.main.linkTaskName('EXECUTABLE', buildType)
doLast {
def programFile = kotlin.targets.linux.compilations.main.getBinary('EXECUTABLE', buildType)
exec {
executable programFile
args ''
}
}
}