Using Kinc with Zig #837
-
Here's the deal: I am wanting to use Kinc in a project of mine. The issue is, I want to use the Zig programming language. If you aren't familiar with Zig, it's a low-level language that has very good support for interacting with C and C++. It has its own build system, which although is still in development is stable enough that some C projects (such as Raylib) are using it though they don't use Zig itself. Look at https://ziglang.org for more info on Zig. Zig's C/C++ compiler uses clang under the hood, in case that matters. I see a few ways to do this:
I would also like to take advantage of Zig's easy cross-compilation feature, so I can just run an export script on my Linux machine to create all of the artifacts. But that's not mandatory, setting up a bunch of VMs for exporting is not the end of the world. Any help is appreciated, thanks! P.S: I noticed |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Simply add an exporter to kmake that creates a zig build file. See https://github.com/Kode/kmake/tree/main/kmake/src/Exporters |
Beta Was this translation helpful? Give feedback.
-
Looking into it further, I think I am going to use bgfx instead of Kinc. I can simply use their amalgamated build (See the |
Beta Was this translation helpful? Give feedback.
-
I've created a helper for linking Kinc with Zig. Here's my repo for the project However, I've encountered an issue that I don't know how to solve; the linker can't find some symbols ( I'm not sure if I'm missing something, or if the |
Beta Was this translation helpful? Give feedback.
I've created a helper for linking Kinc with Zig.
Here's my repo for the project
However, I've encountered an issue that I don't know how to solve; the linker can't find some symbols (
udef_new
,udev_enumerate_new
, etc) and I'm not sure how to fix it.I'm not sure if I'm missing something, or if the
--json
option of kmake is missing something.