Fix build runner optional issue (#725)

This commit is contained in:
Auguste Rame 2022-10-28 04:02:08 -04:00 committed by GitHub
parent 862d30055a
commit ced6e97cc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,11 +142,11 @@ fn processStep(
) anyerror!void {
if (step.cast(InstallArtifactStep)) |install_exe| {
if (install_exe.artifact.root_src) |src| {
const path = switch (src) {
const maybe_path = switch (src) {
.path => |path| path,
.generated => |generated| generated.path,
};
try packages.append(allocator, .{ .name = "root", .path = path });
if (maybe_path) |path| try packages.append(allocator, .{ .name = "root", .path = path });
}
try processIncludeDirs(allocator, include_dirs, install_exe.artifact.include_dirs.items);
@ -156,11 +156,11 @@ fn processStep(
}
} else if (step.cast(LibExeObjStep)) |exe| {
if (exe.root_src) |src| {
const path = switch (src) {
const maybe_path = switch (src) {
.path => |path| path,
.generated => |generated| generated.path,
};
try packages.append(allocator, .{ .name = "root", .path = path });
if (maybe_path) |path| try packages.append(allocator, .{ .name = "root", .path = path });
}
try processIncludeDirs(allocator, include_dirs, exe.include_dirs.items);
try processPkgConfig(allocator, include_dirs, exe);