-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.codegen.zig
33 lines (29 loc) · 1.05 KB
/
build.codegen.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const std = @import("std");
const default_whitelist = [_][]const u8{"cloudcontrol"};
pub fn build(b: *std.Build) void {
const aws = b.dependency("aws", .{ .target = b.graph.host });
const whitelist = b.option(
[]const []const u8,
"filter",
"Whitelist the services to generate",
);
const aws_codegen = b.addRunArtifact(aws.artifact("aws-codegen"));
if (b.lazyDependency("aws-models", .{})) |models| {
const src_dir = models.path("sdk");
aws_codegen.addDirectoryArg(src_dir);
}
const aws_out_dir = aws_codegen.addOutputDirectoryArg("aws");
const sdk_out_dir = aws_codegen.addOutputDirectoryArg("sdk");
aws_codegen.addArgs(whitelist orelse &default_whitelist);
b.getInstallStep().dependOn(&aws_codegen.step);
b.installDirectory(.{
.source_dir = aws_out_dir,
.install_dir = .prefix,
.install_subdir = "../aws/runtime/infra",
});
b.installDirectory(.{
.source_dir = sdk_out_dir,
.install_dir = .prefix,
.install_subdir = "../sdk",
});
}