mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
build: dupe library, rpath, and framework LazyPaths
Without duping, users could get some unexpected behavior if they used a string with a lifetime that didn't persist throughout the full build, i.e. if it wasn't heap allocated, or if it was explicitly freed.
This commit is contained in:
parent
89d660c3eb
commit
76f7b40e15
@ -1072,17 +1072,20 @@ pub fn addConfigHeader(self: *Compile, config_header: *Step.ConfigHeader) void {
|
||||
}
|
||||
|
||||
pub fn addLibraryPath(self: *Compile, directory_source: LazyPath) void {
|
||||
self.lib_paths.append(directory_source) catch @panic("OOM");
|
||||
const b = self.step.owner;
|
||||
self.lib_paths.append(directory_source.dupe(b)) catch @panic("OOM");
|
||||
directory_source.addStepDependencies(&self.step);
|
||||
}
|
||||
|
||||
pub fn addRPath(self: *Compile, directory_source: LazyPath) void {
|
||||
self.rpaths.append(directory_source) catch @panic("OOM");
|
||||
const b = self.step.owner;
|
||||
self.rpaths.append(directory_source.dupe(b)) catch @panic("OOM");
|
||||
directory_source.addStepDependencies(&self.step);
|
||||
}
|
||||
|
||||
pub fn addFrameworkPath(self: *Compile, directory_source: LazyPath) void {
|
||||
self.framework_dirs.append(directory_source) catch @panic("OOM");
|
||||
const b = self.step.owner;
|
||||
self.framework_dirs.append(directory_source.dupe(b)) catch @panic("OOM");
|
||||
directory_source.addStepDependencies(&self.step);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user