{"id":20078413,"url":"https://github.com/hexops-graveyard/mach-system-sdk","last_synced_at":"2025-11-28T05:04:39.531Z","repository":{"id":86747426,"uuid":"466299411","full_name":"hexops-graveyard/mach-system-sdk","owner":"hexops-graveyard","description":"DirectX 12 headers for MinGW/Zig, cross-compile DX12/Metal/etc with Zig, etc.","archived":false,"fork":false,"pushed_at":"2022-03-05T00:28:50.000Z","size":8,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-13T01:09:59.335Z","etag":null,"topics":["zig-package"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hexops-graveyard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"slimsag"}},"created_at":"2022-03-04T23:33:51.000Z","updated_at":"2023-09-30T11:30:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"fbcb386c-35ce-4b1e-b49c-d895ebefdf58","html_url":"https://github.com/hexops-graveyard/mach-system-sdk","commit_stats":null,"previous_names":["hexops-graveyard/mach-system-sdk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexops-graveyard%2Fmach-system-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexops-graveyard%2Fmach-system-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexops-graveyard%2Fmach-system-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexops-graveyard%2Fmach-system-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexops-graveyard","download_url":"https://codeload.github.com/hexops-graveyard/mach-system-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241509658,"owners_count":19974071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["zig-package"],"created_at":"2024-11-13T15:14:21.836Z","updated_at":"2025-11-28T05:04:39.472Z","avatar_url":"https://github.com/hexops-graveyard.png","language":null,"funding_links":["https://github.com/sponsors/slimsag"],"categories":[],"sub_categories":[],"readme":"# mach/system-sdk, more libraries for cross-compilation with Zig \u003ca href=\"https://hexops.com\"\u003e\u003cimg align=\"right\" alt=\"Hexops logo\" src=\"https://raw.githubusercontent.com/hexops/media/master/readme.svg\"\u003e\u003c/img\u003e\u003c/a\u003e\n\n* Updated DirectX 12 headers for use with MinGW/Zig\n* Cross-compile DirectX apps targetting Windows\n* Cross compile Metal apps targetting macOS/iOS Intel or Apple Silicon.\n* Cross compile OpenGL/Vulkan apps targetting Linux (not other OSs, sorry)\n\n## What is this?\n\nOne thing I care about extremely with [Mach engine](https://github.com/hexops/mach) is that you're able to cross compile for any OS with nothing more than `zig` and `git`. And while we can build most things from source (GLFW, and even the DirectX Shader Compiler!) there are a few system headers / libraries where, really, we just need a copy of them.\n\n`mach/system-sdk` is how Mach engine gets a copy of them via the Zig build system.\n\nAlthough it was intended for Mach specifically, and I wouldn't be surprised if one day Zig provides better options out of the box, I realize others might benefit from this and so I've made it easy for anyone to use!\n\n## What does it provide?\n\nDepending on the target OS, `system_sdk.zig` will automatically `git clone` the relevant system SDK for you and include it:\n\n* `sdk-windows-x86_64` (~7MB):\n  * Updated DirectX 12 headers (and prior versions) for use with Zig/MinGW when specifying a `-Dtarget=x86_64-windows-gnu` target.\n  * DirectX libraries such as `dxgi.lib` and `dxguid.lib`\n* `sdk-linux-x86_64` (~40MB):\n  * X11/xcb/Wayland libraries/headers (as static as possible)\n  * OpenGL and Vulkan headers\n  * Generated Wayland protocol sources\n* `sdk-macos-11.3` (~198MB) and `sdk-macos-12.0` (~149MB)\n  * A nearly full copy of the macOS 11.3 and 12.0 XCode SDKs, with just a few particularly large frameworks excluded.\n  * Pretty much every framework, header, etc. that you need to develop macOS and iOS applications for Intel and Apple Silicon.\n  * Symlinks mostly eliminated for ease of use on Windows\n\nThe build script will `git clone` these SDKs for you, pin them to a specific Git revision denoted in the `system_sdk.zig` file so they are versioned, and even prompt for XCode license agreement in the case of macOS SDKs.\n\ninto the appdata directory \n\n```\n/Users/slimsag/Library/Application Support/hexops\n```\n\n## Single file \u0026 one-liner to use\n\nGet [system_sdk.zig](https://github.com/hexops/mach/blob/main/glfw/system_sdk.zig) into your codebase however you prefer. I suggest just copying it for now, it's a single file.\n\nIn your `build.zig`:\n\n```\nconst system_sdk = @import(\"system_sdk.zig\");\n...\nsystem_sdk.include(b, step, .{});\n```\n\nWhere `step` is the exe / lib you're building.\n\n## Shared between Zig projects\n\nThe SDKs are cloned into your `\u003cappdata\u003e/hexops` directory to ensure they are shared across projects and you don't end up with multiple copies. Prior to use the build script will `git reset` to the target revision.\n\n## Customization\n\nIf you don't like what is provided in the SDK repositories, I've tried to make it as easy as possible to switch to your own SDK repos. Just pass `Options`:\n\n```zig\nsystem_sdk.include(b, step, .{\n    .github_org = \"myorg\",\n    .linux_x86_64_revision = \"ab7fa8f3a05b06e0b06f4277b484e27004bfb20f\",\n    .windows_x86_64_revision = \"5acba990efd112ea0ced364f0428e6ef6e7a5541\",\n});\n```\n\nAnd set the revisions to the Git revisions of your forks of [the SDK repositories.](https://github.com/hexops?q=mach-sdk\u0026type=all\u0026language=\u0026sort=)\n\n## Is this the right way to do this? Should I be using this?\n\nTo be clear, I don't think this is the perfect way or 100% ideal way to handle this. I am positive that the Zig community will eventually land on better solutions here.\n\nFor example, generating updated DirectX 12 headers for MinGW/Zig requires patching Microsoft's IDL files, running them through the Wine WIDL compiler, and then some. Storing even a few binaries in Git is not ideal, even if we do clone with `--depth 1`.\n\nBut, if you care about that developer experience as immensely as I do I hope you'll see a bit of reason behind the madness.\n\nUse at your own peril!\n\n## Issues\n\nPlease file issues/complaints in the [main Mach repository](https://github.com/hexops/mach/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexops-graveyard%2Fmach-system-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexops-graveyard%2Fmach-system-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexops-graveyard%2Fmach-system-sdk/lists"}