aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2022-03-19 16:54:11 +0100
committerJakub Konka <kubkon@jakubkonka.com>2022-03-22 07:06:39 +0100
commit0376fd09bc9f29ceeb83760e32532923e4fe7f98 (patch)
tree2458f38c54fa77f642dc41658f3cf89c7af506ea /src/Compilation.zig
parent91fd0f42c88f4bea424b5a5c58435a2a98b57a58 (diff)
downloadzig-0376fd09bc9f29ceeb83760e32532923e4fe7f98.tar.gz
zig-0376fd09bc9f29ceeb83760e32532923e4fe7f98.zip
macho: extend CodeSignature to accept entitlements
With this change, we can now bake in entitlements into the binary. Additionally, I see this as the first step towards full code signature support which includes baking in Apple issued certificates for redistribution, etc.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index f6fe452951..64848659a7 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -815,6 +815,8 @@ pub const InitOptions = struct {
native_darwin_sdk: ?std.zig.system.darwin.DarwinSDK = null,
/// (Darwin) Install name of the dylib
install_name: ?[]const u8 = null,
+ /// (Darwin) Path to entitlements file
+ entitlements: ?[]const u8 = null,
};
fn addPackageTableToCacheHash(
@@ -1624,6 +1626,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
.enable_link_snapshots = options.enable_link_snapshots,
.native_darwin_sdk = options.native_darwin_sdk,
.install_name = options.install_name,
+ .entitlements = options.entitlements,
});
errdefer bin_file.destroy();
comp.* = .{
@@ -2351,6 +2354,7 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes
// Mach-O specific stuff
man.hash.addListOfBytes(comp.bin_file.options.framework_dirs);
man.hash.addListOfBytes(comp.bin_file.options.frameworks);
+ try man.addOptionalFile(comp.bin_file.options.entitlements);
// COFF specific stuff
man.hash.addOptional(comp.bin_file.options.subsystem);