Hi, I’m working on a native project to wrap libgit...
# kotlin-native
m
Hi, I’m working on a native project to wrap libgit2 (similar to the gitchurn example) and perform some tasks on the server-side (Linux). My problem is that I’m using macOS for development, and I need to do cross-compile to build the version for Linux. Most of the examples are using
System.getProperty("os.name")
to identify the target, so it supposes that it would be needed to use the same OS. Is there some example that you can recommend me about how to set up the project properly for cross-compile?
a
This approach is so popular because some parts of build,
cinterop
block for example, should be specified per target. Linux can be targeted from OSX host with no issues, so you can just add
linuxX64 { }
target as in the documentation. The problem is that you should specify cinterop there for the second time.
m
Thanks! Got it, I’m going to try it. So I guess that I would also need to provide for the cinterop, a linkerOpts for the linux with the proper version of libgit2
👍 1