From 0bdb14e5972c3c3885fdb89983649e2d1680b215 Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Thu, 16 May 2019 11:45:39 +0300 Subject: [PATCH] Add Linux/Arm targets to echoServer sample --- samples/echoServer/build.gradle | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/samples/echoServer/build.gradle b/samples/echoServer/build.gradle index c0cc567744f..def74c2b46a 100644 --- a/samples/echoServer/build.gradle +++ b/samples/echoServer/build.gradle @@ -5,12 +5,30 @@ plugins { // Determine host preset. def hostPreset = MPPTools.defaultHostPreset(project) +// Add two additional presets for Raspberry Pi. +def raspberryPiPresets = [kotlin.presets.linuxArm32Hfp, kotlin.presets.linuxArm64] + kotlin { targets { fromPreset(hostPreset, 'echoServer') { compilations.main.outputKinds 'EXECUTABLE' 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 + } } }