Add Linux/Arm targets to echoServer sample
This commit is contained in:
@@ -5,12 +5,30 @@ plugins {
|
|||||||
// Determine host preset.
|
// Determine host preset.
|
||||||
def hostPreset = MPPTools.defaultHostPreset(project)
|
def hostPreset = MPPTools.defaultHostPreset(project)
|
||||||
|
|
||||||
|
// Add two additional presets for Raspberry Pi.
|
||||||
|
def raspberryPiPresets = [kotlin.presets.linuxArm32Hfp, kotlin.presets.linuxArm64]
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
targets {
|
targets {
|
||||||
fromPreset(hostPreset, 'echoServer') {
|
fromPreset(hostPreset, 'echoServer') {
|
||||||
compilations.main.outputKinds 'EXECUTABLE'
|
compilations.main.outputKinds 'EXECUTABLE'
|
||||||
compilations.main.entryPoint 'sample.echoserver.main'
|
compilations.main.entryPoint 'sample.echoserver.main'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
raspberryPiPresets.each { preset ->
|
||||||
|
def targetName = 'echoServer' + preset.name.capitalize()
|
||||||
|
fromPreset(preset, targetName) {
|
||||||
|
compilations.main.outputKinds 'EXECUTABLE'
|
||||||
|
compilations.main.entryPoint 'sample.echoserver.main'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
raspberryPiPresets.each { preset ->
|
||||||
|
String mainSourceSetName = 'echoServer' + preset.name.capitalize() + 'Main'
|
||||||
|
getByName(mainSourceSetName) dependsOn echoServerMain
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user