@@ -257,6 +257,7 @@ pub const LinkObject = union(enum) {
257
257
c_source_file : * CSourceFile ,
258
258
c_source_files : * CSourceFiles ,
259
259
win32_resource_file : * RcSourceFile ,
260
+ win32_manifest_file : LazyPath ,
260
261
};
261
262
262
263
pub const SystemLib = struct {
@@ -952,6 +953,17 @@ pub fn addWin32ResourceFile(self: *Compile, source: RcSourceFile) void {
952
953
source .file .addStepDependencies (& self .step );
953
954
}
954
955
956
+ pub fn addWin32ManifestFile (self : * Compile , source : LazyPath ) void {
957
+ // Only the PE/COFF format has a Resource Table which is where the manifest
958
+ // gets embedded, so for any other target the manifest file is just ignored.
959
+ if (self .target .getObjectFormat () != .coff ) return ;
960
+
961
+ const b = self .step .owner ;
962
+ const source_duped = source .dupe (b );
963
+ self .link_objects .append (.{ .win32_manifest_file = source_duped }) catch @panic ("OOM" );
964
+ source .addStepDependencies (& self .step );
965
+ }
966
+
955
967
pub fn setVerboseLink (self : * Compile , value : bool ) void {
956
968
self .verbose_link = value ;
957
969
}
@@ -1567,6 +1579,10 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
1567
1579
}
1568
1580
try zig_args .append (rc_source_file .file .getPath (b ));
1569
1581
},
1582
+
1583
+ .win32_manifest_file = > | manifest_file | {
1584
+ try zig_args .append (manifest_file .getPath (b ));
1585
+ },
1570
1586
}
1571
1587
}
1572
1588
0 commit comments