std.build: fix -install_name for darwin dynamic C linking

This commit is contained in:
Andrew Kelley 2017-09-23 13:32:17 -04:00
parent eb0867d3f0
commit 2f98676bbe

View File

@ -1306,8 +1306,9 @@ pub const LibExeObjStep = struct {
%%cc_args.append("-current_version"); %%cc_args.append("-current_version");
%%cc_args.append(builder.fmt("{}.{}.{}", self.version.major, self.version.minor, self.version.patch)); %%cc_args.append(builder.fmt("{}.{}.{}", self.version.major, self.version.minor, self.version.patch));
const install_name = builder.pathFromRoot(%%os.path.join(builder.allocator, builder.cache_root, self.major_only_filename));
%%cc_args.append("-install_name"); %%cc_args.append("-install_name");
%%cc_args.append(builder.pathFromRoot(self.major_only_filename)); %%cc_args.append(install_name);
} else { } else {
%%cc_args.append("-fPIC"); %%cc_args.append("-fPIC");
%%cc_args.append("-shared"); %%cc_args.append("-shared");