| ... | @@ -42,7 +42,6 @@ unwind_tables: ?bool, | ... | @@ -42,7 +42,6 @@ unwind_tables: ?bool, |
| 42 | compress_debug_sections: enum { none, zlib } = .none, | 42 | compress_debug_sections: enum { none, zlib } = .none, |
| 43 | lib_paths: ArrayList(LazyPath), | 43 | lib_paths: ArrayList(LazyPath), |
| 44 | rpaths: ArrayList(LazyPath), | 44 | rpaths: ArrayList(LazyPath), |
| 45 | framework_dirs: ArrayList(FrameworkDir), | | |
| 46 | frameworks: StringHashMap(FrameworkLinkInfo), | 45 | frameworks: StringHashMap(FrameworkLinkInfo), |
| 47 | verbose_link: bool, | 46 | verbose_link: bool, |
| 48 | verbose_cc: bool, | 47 | verbose_cc: bool, |
| ... | @@ -261,15 +260,12 @@ const FrameworkLinkInfo = struct { | ... | @@ -261,15 +260,12 @@ const FrameworkLinkInfo = struct { |
| 261 | pub const IncludeDir = union(enum) { | 260 | pub const IncludeDir = union(enum) { |
| 262 | path: LazyPath, | 261 | path: LazyPath, |
| 263 | path_system: LazyPath, | 262 | path_system: LazyPath, |
| | 263 | framework_path: LazyPath, |
| | 264 | framework_path_system: LazyPath, |
| 264 | other_step: *Compile, | 265 | other_step: *Compile, |
| 265 | config_header_step: *Step.ConfigHeader, | 266 | config_header_step: *Step.ConfigHeader, |
| 266 | }; | 267 | }; |
| 267 | | 268 | |
| 268 | pub const FrameworkDir = union(enum) { | | |
| 269 | path: LazyPath, | | |
| 270 | path_system: LazyPath, | | |
| 271 | }; | | |
| 272 | | | |
| 273 | pub const Options = struct { | 269 | pub const Options = struct { |
| 274 | name: []const u8, | 270 | name: []const u8, |
| 275 | root_source_file: ?LazyPath = null, | 271 | root_source_file: ?LazyPath = null, |
| ... | @@ -447,7 +443,6 @@ pub fn create(owner: *std.Build, options: Options) *Compile { | ... | @@ -447,7 +443,6 @@ pub fn create(owner: *std.Build, options: Options) *Compile { |
| 447 | .c_macros = ArrayList([]const u8).init(owner.allocator), | 443 | .c_macros = ArrayList([]const u8).init(owner.allocator), |
| 448 | .lib_paths = ArrayList(LazyPath).init(owner.allocator), | 444 | .lib_paths = ArrayList(LazyPath).init(owner.allocator), |
| 449 | .rpaths = ArrayList(LazyPath).init(owner.allocator), | 445 | .rpaths = ArrayList(LazyPath).init(owner.allocator), |
| 450 | .framework_dirs = ArrayList(FrameworkDir).init(owner.allocator), | | |
| 451 | .installed_headers = ArrayList(*Step).init(owner.allocator), | 446 | .installed_headers = ArrayList(*Step).init(owner.allocator), |
| 452 | .c_std = std.Build.CStd.C99, | 447 | .c_std = std.Build.CStd.C99, |
| 453 | .zig_lib_dir = null, | 448 | .zig_lib_dir = null, |
| ... | @@ -1057,14 +1052,13 @@ pub fn addRPath(self: *Compile, directory_source: LazyPath) void { | ... | @@ -1057,14 +1052,13 @@ pub fn addRPath(self: *Compile, directory_source: LazyPath) void { |
| 1057 | | 1052 | |
| 1058 | pub fn addSystemFrameworkPath(self: *Compile, directory_source: LazyPath) void { | 1053 | pub fn addSystemFrameworkPath(self: *Compile, directory_source: LazyPath) void { |
| 1059 | const b = self.step.owner; | 1054 | const b = self.step.owner; |
| 1060 | self.framework_dirs.append(FrameworkDir{ .path_system = directory_source.dupe(b) }) catch | 1055 | self.include_dirs.append(IncludeDir{ .framework_path_system = directory_source.dupe(b) }) catch @panic("OOM"); |
| 1061 | @panic("OOM"); | | |
| 1062 | directory_source.addStepDependencies(&self.step); | 1056 | directory_source.addStepDependencies(&self.step); |
| 1063 | } | 1057 | } |
| 1064 | | 1058 | |
| 1065 | pub fn addFrameworkPath(self: *Compile, directory_source: LazyPath) void { | 1059 | pub fn addFrameworkPath(self: *Compile, directory_source: LazyPath) void { |
| 1066 | const b = self.step.owner; | 1060 | const b = self.step.owner; |
| 1067 | self.framework_dirs.append(FrameworkDir{ .path = directory_source.dupe(b) }) catch @panic("OOM"); | 1061 | self.include_dirs.append(IncludeDir{ .framework_path = directory_source.dupe(b) }) catch @panic("OOM"); |
| 1068 | directory_source.addStepDependencies(&self.step); | 1062 | directory_source.addStepDependencies(&self.step); |
| 1069 | } | 1063 | } |
| 1070 | | 1064 | |
| ... | @@ -1787,6 +1781,14 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { | ... | @@ -1787,6 +1781,14 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 1787 | try zig_args.append("-isystem"); | 1781 | try zig_args.append("-isystem"); |
| 1788 | try zig_args.append(include_path.getPath(b)); | 1782 | try zig_args.append(include_path.getPath(b)); |
| 1789 | }, | 1783 | }, |
| | 1784 | .framework_path => |include_path| { |
| | 1785 | try zig_args.append("-F"); |
| | 1786 | try zig_args.append(include_path.getPath2(b, step)); |
| | 1787 | }, |
| | 1788 | .framework_path_system => |include_path| { |
| | 1789 | try zig_args.append("-iframework"); |
| | 1790 | try zig_args.append(include_path.getPath2(b, step)); |
| | 1791 | }, |
| 1790 | .other_step => |other| { | 1792 | .other_step => |other| { |
| 1791 | if (other.generated_h) |header| { | 1793 | if (other.generated_h) |header| { |
| 1792 | try zig_args.append("-isystem"); | 1794 | try zig_args.append("-isystem"); |
| ... | @@ -1840,19 +1842,6 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { | ... | @@ -1840,19 +1842,6 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 1840 | zig_args.appendAssumeCapacity(rpath.getPath2(b, step)); | 1842 | zig_args.appendAssumeCapacity(rpath.getPath2(b, step)); |
| 1841 | } | 1843 | } |
| 1842 | | 1844 | |
| 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 | } | | |
| 1854 | } | | |
| 1855 | | | |
| 1856 | { | 1845 | { |
| 1857 | var it = self.frameworks.iterator(); | 1846 | var it = self.frameworks.iterator(); |
| 1858 | while (it.next()) |entry| { | 1847 | while (it.next()) |entry| { |