1/* 2 * Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 5/* 6 * This is a hack to avoid creating unsupported native source sets when importing project into IDEA 7 */ 8project.ext.ideaActive = System.getProperty('idea.active') == 'true' 9 10kotlin { 11 targets { 12 def manager = project.ext.hostManager 13 def linuxEnabled = manager.isEnabled(presets.linuxX64.konanTarget) 14 def macosEnabled = manager.isEnabled(presets.macosX64.konanTarget) 15 def winEnabled = manager.isEnabled(presets.mingwX64.konanTarget) 16 17 project.ext.isLinuxHost = linuxEnabled 18 project.ext.isMacosHost = macosEnabled 19 project.ext.isWinHost = winEnabled 20 21 if (project.ext.ideaActive) { 22 def ideaPreset = presets.linuxX64 23 if (winEnabled) ideaPreset = presets.mingwX64 24 if (macosEnabled) ideaPreset = presets.macosX64 25 project.ext.ideaPreset = ideaPreset 26 } 27 } 28} 29