Rafael Tonholo
10/04/2026, 3:21 PMgodot target.
I was able to create a target from scratch. KGP detects it as an actual platform target; however, I was not able to trigger the compiler plugin phases nor generate a klib.
The only way I was actually able to do that was by creating the new target by extending KotlinJsIrTarget, but that forced me to write some FIR checkers to mark the usage of some Kotlin/JS function as an error, and strip out some default dependencies added by the target.
Thanks in advance.hfhbd
10/04/2026, 3:25 PMRafael Tonholo
10/04/2026, 3:35 PMhfhbd
10/04/2026, 3:42 PMRafael Tonholo
10/04/2026, 3:45 PMRafael Tonholo
10/04/2026, 3:46 PMhfhbd
10/04/2026, 3:48 PMRafael Tonholo
10/04/2026, 3:50 PMtapchicoma
10/05/2026, 10:59 AMRafael Tonholo
10/06/2026, 1:22 AMRafael Tonholo
10/06/2026, 1:23 AMtapchicoma
10/06/2026, 3:44 PMso I could prevent developers from using KMP libraries that do not have aWhat is the actual limitation here? Only be able to use specific JS (?) API?target.godot
Rafael Tonholo
10/06/2026, 3:47 PMWhat is the actual limitation here? Only be able to use specific JS (?) API?There are actually a few limitations: 1. The use of Kotlin/JS specific APIs 2. The usage of
external declarations that would map to JS modules; I do support external declarations, but via annotations since I can't use the external keyword
3. Usage of third-party Kotlin/JS libraries, which would be very problematic since the platform APIs differ.tapchicoma
10/06/2026, 3:56 PMnodejs() or browser() , but for GDScriptRafael Tonholo
10/06/2026, 3:58 PMtapchicoma
10/06/2026, 4:04 PMRafael Tonholo
10/06/2026, 4:08 PMKotlinPlatformType.common doesn't work, though, since it was not triggering the IRtapchicoma
10/06/2026, 4:09 PMRafael Tonholo
10/06/2026, 4:16 PMcommonMain and `actual`/`expect`, then add these targets to be pluggable into KGP or Kotlin toolchain (preferably).
Then, if the target plugin is added to the project classpath, KGP or Kotlin toolchain would enable them to be usedRafael Tonholo
10/06/2026, 4:17 PMexpect, but I can live without it and keep using the annotation's approach