Skip to content

System libraries and headers for cross-compiling zig-gamedev libs & sample apps

License

Notifications You must be signed in to change notification settings

zig-gamedev/system_sdk

Repository files navigation

System libraries and headers for cross-compiling zig-gamedev libs and sample applications.

Usage

build.zig

    switch (target.os.tag) {
        .windows => {
            if (target.cpu.arch.isX86()) {
                if (target.abi.isGnu() or target.abi.isMusl()) {
                    if (b.lazyDependency("system_sdk", .{})) |system_sdk| {
                        compile_step.addLibraryPath(system_sdk.path("windows/lib/x86_64-windows-gnu"));
                    }
                }
            }
        },
        .macos => {
            if (b.lazyDependency("system_sdk", .{})) |system_sdk| {
                compile_step.addLibraryPath(system_sdk.path("macos12/usr/lib"));
                compile_step.addFrameworkPath(system_sdk.path("macos12/System/Library/Frameworks"));
            }
        },
        .linux => {
            if (target.cpu.arch.isX86()) {
                if (b.lazyDependency("system_sdk", .{})) |system_sdk| {
                    compile_step.addLibraryPath(system_sdk.path("linux/lib/x86_64-linux-gnu"));
                }
            } else if (target.cpu.arch == .aarch64) {
                if (b.lazyDependency("system_sdk", .{})) |system_sdk| {
                    compile_step.addLibraryPath(system_sdk.path("linux/lib/aarch64-linux-gnu"));
                }
            }
        },
        else => {},
    }

About

System libraries and headers for cross-compiling zig-gamedev libs & sample apps

Topics

Resources

License

Stars

Watchers

Forks