authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-04-30 20:11:35-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-04-30 20:11:35-04:00
log2c6827064cf35be261790bfec29f88244c387c06
tree57e3ee36b0f22912d54ad0e399fdb9f6285307df
parent1ec89b02866cdf14b1c4309bbae7d4f5e4ee6ae7

fix regression from previous commit


3 files changed, 11 insertions(+), 10 deletions(-)

example/mix_o_files/build.zig+1-1
......@@ -12,7 +12,7 @@ pub fn build(b: &Builder) {
1212
1313 b.default_step.dependOn(&exe.step);
1414
15 const run_cmd = b.addCommand(b.cache_root, b.env_map, "./test", [][]const u8{});
15 const run_cmd = b.addCommand(".", b.env_map, exe.getOutputPath(), [][]const u8{});
1616 run_cmd.step.dependOn(&exe.step);
1717
1818 const test_step = b.step("test", "Test the program");
example/shared_library/build.zig+1-1
......@@ -12,7 +12,7 @@ pub fn build(b: &Builder) {
1212
1313 b.default_step.dependOn(&exe.step);
1414
15 const run_cmd = b.addCommand(b.cache_root, b.env_map, "./test", [][]const u8{});
15 const run_cmd = b.addCommand(".", b.env_map, exe.getOutputPath(), [][]const u8{});
1616 run_cmd.step.dependOn(&exe.step);
1717
1818 const test_step = b.step("test", "Test the program");
std/build.zig+9-8
......@@ -505,7 +505,6 @@ pub const Builder = struct {
505505 };
506506
507507 const term = child.wait() %% |err| {
508 test (cwd) |yes_cwd| %%io.stderr.printf("cwd: {}\n", yes_cwd);
509508 %%io.stderr.printf("Unable to spawn {}: {}\n", exe_path, @errorName(err));
510509 return err;
511510 };
......@@ -1213,11 +1212,11 @@ pub const CLibExeObjStep = struct {
12131212 %%cc_args.append("-fPIC");
12141213 }
12151214
1215 const abs_source_file = builder.pathFromRoot(source_file);
12161216 %%cc_args.append("-c");
1217 %%cc_args.append(source_file);
1217 %%cc_args.append(abs_source_file);
12181218
1219 const rel_src_path = %%os.path.relative(builder.allocator, builder.build_root, source_file);
1220 const cache_o_src = %%os.path.join(builder.allocator, builder.cache_root, rel_src_path);
1219 const cache_o_src = %%os.path.join(builder.allocator, builder.cache_root, source_file);
12211220 const cache_o_dir = os.path.dirname(cache_o_src);
12221221 %return builder.makePath(cache_o_dir);
12231222 const cache_o_file = builder.fmt("{}{}", cache_o_src, self.target.oFileExt());
......@@ -1230,7 +1229,7 @@ pub const CLibExeObjStep = struct {
12301229
12311230 for (self.include_dirs.toSliceConst()) |dir| {
12321231 %%cc_args.append("-I");
1233 %%cc_args.append(dir);
1232 %%cc_args.append(builder.pathFromRoot(dir));
12341233 }
12351234
12361235 %return builder.spawnChild(cc, cc_args.toSliceConst());
......@@ -1279,11 +1278,11 @@ pub const CLibExeObjStep = struct {
12791278 for (self.source_files.toSliceConst()) |source_file| {
12801279 %%cc_args.resize(0);
12811280
1281 const abs_source_file = builder.pathFromRoot(source_file);
12821282 %%cc_args.append("-c");
1283 %%cc_args.append(builder.pathFromRoot(source_file));
1283 %%cc_args.append(abs_source_file);
12841284
1285 const rel_src_path = %%os.path.relative(builder.allocator, builder.build_root, source_file);
1286 const cache_o_src = %%os.path.join(builder.allocator, builder.cache_root, rel_src_path);
1285 const cache_o_src = %%os.path.join(builder.allocator, builder.cache_root, source_file);
12871286 const cache_o_dir = os.path.dirname(cache_o_src);
12881287 %return builder.makePath(cache_o_dir);
12891288 const cache_o_file = builder.fmt("{}{}", cache_o_src, self.target.oFileExt());
......@@ -1324,6 +1323,8 @@ pub const CLibExeObjStep = struct {
13241323 for (self.full_path_libs.toSliceConst()) |full_path_lib| {
13251324 %%cc_args.append(builder.pathFromRoot(full_path_lib));
13261325 }
1326
1327 %return builder.spawnChild(cc, cc_args.toSliceConst());
13271328 },
13281329 }
13291330 }