colbyhall/objective-zig-gen
Obejctive-C to Zig bindgen.
objective-zig-gen
is a work-in-progress tool for generating Objective-C bindings from Zig. This project aims to streamline the process of integrating Objective-C code with Zig, providing developers with a seamless way to interact with Objective-C APIs from Zig projects. You can find generated bindings in objective-zig.
Since this project is under active development, it's recommended to clone the repository and build from source:
git clone https://github.com/colbyhall/zigobjcgen.git
cd zigobjcgen
zig build
The program works off of a manifest file that list out xtool sdk frameworks, their dependencies, and other information for formatting the types.
objective-zig-gen <path/to/manifest.json>
Here is an example manifest file
[
{
"name": "Security",
"output_file": "security"
},
{
"name": "CoreFoundation",
"output_file": "cf",
"remove_prefix": "CF"
},
{
"name": "CoreServices",
"output_file": "cs",
"dependencies": [
"CoreFoundation"
]
},
{
"name": "Foundation",
"output_file": "ns",
"remove_prefix": "NS",
"dependencies": [
"CoreServices",
"CoreFoundation",
"Security"
]
}
]
In Progress | Complete type mapping for all Objective-C types. (Protocols, Interfaces, Blocks)
Zig interface for writing Objective-C ABI compatible Zig.
Comprehensive test and benchmarking.
Contributions are welcome! Feel free to open issues or submit pull requests if you want to help improve the project.
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This project is actively being developed and is not ready for production use. Expect frequent changes and updates.