Hi, I wonder how K/N cross compile very well. When...
# kotlin-native
a
Hi, I wonder how K/N cross compile very well. When writing JNI, I literally have no option other than create a VM download and install c/c++ toolchains, and then compile. I'd like to know how K/N exactly do this so I can take an inspiration and probably try something 🙂, anybody can provide some info?
m
a
Thanks, it gave me an idea!!
@msink Hi seems like you're already experienced with meson. Can you help me figure out what's wrong in my setup that it says
Copy code
..\meson.build:14:0: ERROR: Unknown variable "binaries".
meson.build
:
Copy code
project('c++ foolib', 'cpp',
  version : '1.0.0',
  license : 'MIT')

foo_sources = ['source1.cpp']
shared_library('foo', foo_sources)

[target_machine]
system = 'linux'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

[binaries]
c          = '\\\\wsl$\\Ubuntu\\usr\\bin\\gcc'
cpp        = '\\\\wsl$\\Ubuntu\\usr\\bin\\g++'
m
Well, I did hello-world test repo 4 years ago, but not touched it since then: https://github.com/msink/hello-c In short - [target_machine] and [binaries] should be in separate file, not in meson.build, and --cross-file command line option should refer to that file
👍 1
😄 1