| ... | @@ -108,7 +108,7 @@ object_src: []const u8, | ... | @@ -108,7 +108,7 @@ object_src: []const u8, |
| 108 | link_objects: ArrayList(LinkObject), | 108 | link_objects: ArrayList(LinkObject), |
| 109 | include_dirs: ArrayList(IncludeDir), | 109 | include_dirs: ArrayList(IncludeDir), |
| 110 | c_macros: ArrayList([]const u8), | 110 | c_macros: ArrayList([]const u8), |
| 111 | installed_headers: ArrayList(*std.build.InstallFileStep), | 111 | installed_headers: ArrayList(*std.build.Step), |
| 112 | output_dir: ?[]const u8, | 112 | output_dir: ?[]const u8, |
| 113 | is_linking_libc: bool = false, | 113 | is_linking_libc: bool = false, |
| 114 | is_linking_libcpp: bool = false, | 114 | is_linking_libcpp: bool = false, |
| ... | @@ -371,7 +371,7 @@ fn initExtraArgs( | ... | @@ -371,7 +371,7 @@ fn initExtraArgs( |
| 371 | .lib_paths = ArrayList([]const u8).init(builder.allocator), | 371 | .lib_paths = ArrayList([]const u8).init(builder.allocator), |
| 372 | .rpaths = ArrayList([]const u8).init(builder.allocator), | 372 | .rpaths = ArrayList([]const u8).init(builder.allocator), |
| 373 | .framework_dirs = ArrayList([]const u8).init(builder.allocator), | 373 | .framework_dirs = ArrayList([]const u8).init(builder.allocator), |
| 374 | .installed_headers = ArrayList(*std.build.InstallFileStep).init(builder.allocator), | 374 | .installed_headers = ArrayList(*std.build.Step).init(builder.allocator), |
| 375 | .object_src = undefined, | 375 | .object_src = undefined, |
| 376 | .c_std = Builder.CStd.C99, | 376 | .c_std = Builder.CStd.C99, |
| 377 | .override_lib_dir = null, | 377 | .override_lib_dir = null, |
| ... | @@ -478,7 +478,21 @@ pub fn installHeader(a: *LibExeObjStep, src_path: []const u8) void { | ... | @@ -478,7 +478,21 @@ pub fn installHeader(a: *LibExeObjStep, src_path: []const u8) void { |
| 478 | const basename = fs.path.basename(src_path); | 478 | const basename = fs.path.basename(src_path); |
| 479 | const install_file = a.builder.addInstallHeaderFile(src_path, basename); | 479 | const install_file = a.builder.addInstallHeaderFile(src_path, basename); |
| 480 | a.builder.getInstallStep().dependOn(&install_file.step); | 480 | a.builder.getInstallStep().dependOn(&install_file.step); |
| 481 | a.installed_headers.append(install_file) catch unreachable; | 481 | a.installed_headers.append(&install_file.step) catch unreachable; |
| | 482 | } |
| | 483 | |
| | 484 | pub fn installHeadersDirectory( |
| | 485 | a: *LibExeObjStep, |
| | 486 | src_dir_path: []const u8, |
| | 487 | dest_rel_path: []const u8, |
| | 488 | ) void { |
| | 489 | const install_dir = a.builder.addInstallDirectory(.{ |
| | 490 | .source_dir = src_dir_path, |
| | 491 | .install_dir = .header, |
| | 492 | .install_subdir = dest_rel_path, |
| | 493 | }); |
| | 494 | a.builder.getInstallStep().dependOn(&install_dir.step); |
| | 495 | a.installed_headers.append(&install_dir.step) catch unreachable; |
| 482 | } | 496 | } |
| 483 | | 497 | |
| 484 | /// Creates a `RunStep` with an executable built with `addExecutable`. | 498 | /// Creates a `RunStep` with an executable built with `addExecutable`. |
| ... | @@ -1701,9 +1715,9 @@ fn make(step: *Step) !void { | ... | @@ -1701,9 +1715,9 @@ fn make(step: *Step) !void { |
| 1701 | try zig_args.append("-isystem"); | 1715 | try zig_args.append("-isystem"); |
| 1702 | try zig_args.append(fs.path.dirname(h_path).?); | 1716 | try zig_args.append(fs.path.dirname(h_path).?); |
| 1703 | } | 1717 | } |
| 1704 | if (other.installed_headers.items.len != 0) { | 1718 | if (other.installed_headers.items.len > 0) { |
| 1705 | for (other.installed_headers.items) |install_file| { | 1719 | for (other.installed_headers.items) |install_step| { |
| 1706 | try install_file.step.make(); | 1720 | try install_step.make(); |
| 1707 | } | 1721 | } |
| 1708 | try zig_args.append("-I"); | 1722 | try zig_args.append("-I"); |
| 1709 | try zig_args.append(builder.pathJoin(&.{ | 1723 | try zig_args.append(builder.pathJoin(&.{ |