| ... | ... | @@ -42,7 +42,7 @@ unwind_tables: ?bool, |
| 42 | 42 | compress_debug_sections: enum { none, zlib } = .none, |
| 43 | 43 | lib_paths: ArrayList(LazyPath), |
| 44 | 44 | rpaths: ArrayList(LazyPath), |
| 45 | | framework_dirs: ArrayList(LazyPath), |
| 45 | framework_dirs: ArrayList(FrameworkDir), |
| 46 | 46 | frameworks: StringHashMap(FrameworkLinkInfo), |
| 47 | 47 | verbose_link: bool, |
| 48 | 48 | verbose_cc: bool, |
| ... | ... | @@ -265,6 +265,11 @@ pub const IncludeDir = union(enum) { |
| 265 | 265 | config_header_step: *Step.ConfigHeader, |
| 266 | 266 | }; |
| 267 | 267 | |
| 268 | pub const FrameworkDir = union(enum) { |
| 269 | path: LazyPath, |
| 270 | path_system: LazyPath, |
| 271 | }; |
| 272 | |
| 268 | 273 | pub const Options = struct { |
| 269 | 274 | name: []const u8, |
| 270 | 275 | root_source_file: ?LazyPath = null, |
| ... | ... | @@ -442,7 +447,7 @@ pub fn create(owner: *std.Build, options: Options) *Compile { |
| 442 | 447 | .c_macros = ArrayList([]const u8).init(owner.allocator), |
| 443 | 448 | .lib_paths = ArrayList(LazyPath).init(owner.allocator), |
| 444 | 449 | .rpaths = ArrayList(LazyPath).init(owner.allocator), |
| 445 | | .framework_dirs = ArrayList(LazyPath).init(owner.allocator), |
| 450 | .framework_dirs = ArrayList(FrameworkDir).init(owner.allocator), |
| 446 | 451 | .installed_headers = ArrayList(*Step).init(owner.allocator), |
| 447 | 452 | .c_std = std.Build.CStd.C99, |
| 448 | 453 | .zig_lib_dir = null, |
| ... | ... | @@ -1050,9 +1055,16 @@ pub fn addRPath(self: *Compile, directory_source: LazyPath) void { |
| 1050 | 1055 | directory_source.addStepDependencies(&self.step); |
| 1051 | 1056 | } |
| 1052 | 1057 | |
| 1058 | pub fn addSystemFrameworkPath(self: *Compile, directory_source: LazyPath) void { |
| 1059 | const b = self.step.owner; |
| 1060 | self.framework_dirs.append(FrameworkDir{ .path_system = directory_source.dupe(b) }) catch |
| 1061 | @panic("OOM"); |
| 1062 | directory_source.addStepDependencies(&self.step); |
| 1063 | } |
| 1064 | |
| 1053 | 1065 | pub fn addFrameworkPath(self: *Compile, directory_source: LazyPath) void { |
| 1054 | 1066 | const b = self.step.owner; |
| 1055 | | self.framework_dirs.append(directory_source.dupe(b)) catch @panic("OOM"); |
| 1067 | self.framework_dirs.append(FrameworkDir{ .path = directory_source.dupe(b) }) catch @panic("OOM"); |
| 1056 | 1068 | directory_source.addStepDependencies(&self.step); |
| 1057 | 1069 | } |
| 1058 | 1070 | |
| ... | ... | @@ -1828,9 +1840,17 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 1828 | 1840 | zig_args.appendAssumeCapacity(rpath.getPath2(b, step)); |
| 1829 | 1841 | } |
| 1830 | 1842 | |
| 1831 | | for (self.framework_dirs.items) |directory_source| { |
| 1832 | | try zig_args.append("-F"); |
| 1833 | | try zig_args.append(directory_source.getPath2(b, step)); |
| 1843 | for (self.framework_dirs.items) |framework_dir| { |
| 1844 | switch (framework_dir) { |
| 1845 | .path => |p| { |
| 1846 | try zig_args.append("-F"); |
| 1847 | try zig_args.append(p.getPath2(b, step)); |
| 1848 | }, |
| 1849 | .path_system => |p| { |
| 1850 | try zig_args.append("-iframework"); |
| 1851 | try zig_args.append(p.getPath2(b, step)); |
| 1852 | }, |
| 1853 | } |
| 1834 | 1854 | } |
| 1835 | 1855 | |
| 1836 | 1856 | { |