| ... | @@ -178,6 +178,7 @@ pub const Builder = struct { | ... | @@ -178,6 +178,7 @@ pub const Builder = struct { |
| 178 | return CLibExeObjStep.createObject(self, name, src); | 178 | return CLibExeObjStep.createObject(self, name, src); |
| 179 | } | 179 | } |
| 180 | | 180 | |
| | 181 | /// ::args are copied. |
| 181 | pub fn addCommand(self: &Builder, cwd: ?[]const u8, env_map: &const BufMap, | 182 | pub fn addCommand(self: &Builder, cwd: ?[]const u8, env_map: &const BufMap, |
| 182 | path: []const u8, args: []const []const u8) -> &CommandStep | 183 | path: []const u8, args: []const []const u8) -> &CommandStep |
| 183 | { | 184 | { |
| ... | @@ -1469,10 +1470,11 @@ pub const CommandStep = struct { | ... | @@ -1469,10 +1470,11 @@ pub const CommandStep = struct { |
| 1469 | step: Step, | 1470 | step: Step, |
| 1470 | builder: &Builder, | 1471 | builder: &Builder, |
| 1471 | exe_path: []const u8, | 1472 | exe_path: []const u8, |
| 1472 | args: []const []const u8, | 1473 | args: [][]const u8, |
| 1473 | cwd: ?[]const u8, | 1474 | cwd: ?[]const u8, |
| 1474 | env_map: &const BufMap, | 1475 | env_map: &const BufMap, |
| 1475 | | 1476 | |
| | 1477 | /// ::args are copied. |
| 1476 | pub fn create(builder: &Builder, cwd: ?[]const u8, env_map: &const BufMap, | 1478 | pub fn create(builder: &Builder, cwd: ?[]const u8, env_map: &const BufMap, |
| 1477 | exe_path: []const u8, args: []const []const u8) -> &CommandStep | 1479 | exe_path: []const u8, args: []const []const u8) -> &CommandStep |
| 1478 | { | 1480 | { |
| ... | @@ -1481,10 +1483,11 @@ pub const CommandStep = struct { | ... | @@ -1481,10 +1483,11 @@ pub const CommandStep = struct { |
| 1481 | .builder = builder, | 1483 | .builder = builder, |
| 1482 | .step = Step.init(exe_path, builder.allocator, make), | 1484 | .step = Step.init(exe_path, builder.allocator, make), |
| 1483 | .exe_path = exe_path, | 1485 | .exe_path = exe_path, |
| 1484 | .args = args, | 1486 | .args = %%builder.allocator.alloc([]u8, args.len), |
| 1485 | .cwd = cwd, | 1487 | .cwd = cwd, |
| 1486 | .env_map = env_map, | 1488 | .env_map = env_map, |
| 1487 | }; | 1489 | }; |
| | 1490 | mem.copy([]const u8, self.args, args); |
| 1488 | return self; | 1491 | return self; |
| 1489 | } | 1492 | } |
| 1490 | | 1493 | |