{"id":15394909,"url":"https://github.com/kassane/anotherbuildstep","last_synced_at":"2025-04-15T23:53:38.033Z","repository":{"id":219805800,"uuid":"749963212","full_name":"kassane/anotherBuildStep","owner":"kassane","description":"zig build add-on (add more toolchains [LLVM-based] support)","archived":false,"fork":false,"pushed_at":"2025-04-11T14:09:15.000Z","size":114,"stargazers_count":10,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T15:28:17.362Z","etag":null,"topics":["build-system","cross-compilation","cross-compile","d","dlang","flang","fortran","rust","swift","zig","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kassane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-29T18:21:59.000Z","updated_at":"2025-04-11T14:09:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"d285c8a7-6522-4f95-ab6d-cae9c81071ef","html_url":"https://github.com/kassane/anotherBuildStep","commit_stats":{"total_commits":71,"total_committers":1,"mean_commits":71.0,"dds":0.0,"last_synced_commit":"0457a46f52c6151b754437c5b5e0b01856d34fa4"},"previous_names":["kassane/anotherbuildstep"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2FanotherBuildStep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2FanotherBuildStep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2FanotherBuildStep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2FanotherBuildStep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kassane","download_url":"https://codeload.github.com/kassane/anotherBuildStep/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["build-system","cross-compilation","cross-compile","d","dlang","flang","fortran","rust","swift","zig","zig-package"],"created_at":"2024-10-01T15:24:52.369Z","updated_at":"2025-04-15T23:53:38.028Z","avatar_url":"https://github.com/kassane.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# anotherBuildStep (a.k.a aBS)\n\n## Overview\n\n`anotherBuildStep` is a project designed to leverage the Zig build system (`build.zig`) for building projects with various other toolchains. This allows developers to use Zig as a unified build system across different environments and toolsets.\n\n## TODO\n\n- [x] ldc2 support\n- [x] flang-new support\n- [x] rustc (no cargo) support\n- [ ] ~~rustc (cargo) support~~ (need to figure out how to get the cargo build system to work)\n- [x] swiftc-6 support\n\n## Required\n\n- [zig](https://ziglang.org/download) v0.14.0 or master\n\n\n## Supported\n\n- [ldc2](https://ldc-developers.github.io/) v1.38.0 or latest-CI\n- [flang](https://flang.llvm.org) (a.k.a flang-new) LLVM-18.1.3 or master\n- [rustc](https://www.rust-lang.org/tools/install) stable or nightly\n- [swift](https://swift.org/download/) v6.0 or main-snapshots\n\n\n## Usage\n\nMake new project or add to existing project:\n\nIn project folder, add this package as dependency on your `build.zig.zon`\n\n```bash\n$ zig fetch --save=abs git+https://github.com/kassane/anotherBuildStep\n```\n- add `const abs = @import(\"abs\")` in `build.zig`\n\n```zig\nconst std = @import(\"std\");\n// get build.zig from pkg to extend your build.zig project (only pub content module)\nconst abs = @import(\"abs\");\n// Dlang\nconst ldc2 = abs.ldc2;\n// Fortran\nconst flang = abs.flang;\n// Rust\nconst rustc = abs.rust;\n// Swift\nconst swiftc = abs.swift;\n// zig-cc wrapper\nconst zcc = abs.zcc;\n\npub fn build(b: *std.Build) !void {\n    const target = b.standardTargetOptions(.{});\n    const optimize = b.standardOptimizeOption(.{});\n    \n    const exeDlang = try ldc2.BuildStep(b, .{\n        .name = \"d_example\",\n        .target = target,\n        .optimize = optimize,\n        .sources = \u0026.{\n            \"src/main.d\",\n        },\n        .dflags = \u0026.{\n            \"-w\",\n        },\n    });\n    b.default_step.dependOn(\u0026exeDlang.step);\n\n    // or\n    \n    const exeFortran = try flang.BuildStep(b, .{\n        .name = \"fortran_example\",\n        .target = target,\n        .optimize = optimize,\n        .sources = \u0026.{\n            \"src/main.f90\",\n        },\n        .use_zigcc = true,\n    });\n    b.default_step.dependOn(\u0026exeFortran.step);\n\n    // or\n\n    const exeRust = try rustc.BuildStep(b, .{\n        .name = \"rust_example\",\n        .target = target,\n        .optimize = optimize,\n        .source = b.path(\"src/main.rs\"),\n        .rflags = \u0026.{\n            \"-C\",\n            \"panic=abort\",\n        },\n    });\n    b.default_step.dependOn(\u0026exeRust.step);\n\n    // or\n\n    const exeSwift = try swift.BuildStep(b, .{\n        .name = \"swift_example\",\n        .target = target,\n        .optimize = optimize,\n        .sources = \u0026.{\n            \"examples/main.swift\",\n        },\n        .use_zigcc = true,\n    });\n    b.default_step.dependOn(\u0026exeSwift.step);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkassane%2Fanotherbuildstep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkassane%2Fanotherbuildstep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkassane%2Fanotherbuildstep/lists"}