Is there a way to set the PATH environment during a build.zig run? Lets say I have a shared lib that I want to use during runtime. I do not want to copy this shared lib to my current folder but I want to use it from another folder. I was hoping to simply set my PATH variable to point to it during zig build run. Is this possible to do in build.zig?
#Setting environment during build
1 messages · Page 1 of 1 (latest)
use LD_LIBRARY_PATH instead
is there a way to do this from build.zig right before it runs the executable?
you can change environment variables by changing the .env_map field from what addRunArtifact returns
var run_cmd = b.addRunArtifact(exe);
try run_cmd.env_map.put("LD_LIBRARY_PATH", "/other/path");