#proper way to get build target when you're a module

1 messages · Page 1 of 1 (latest)

violet lagoon
#

the build.zig should have const target = b.standardTargetOptions(.{}) and then you can switch on that value. make sure when using the dependency to pass the target and optimize, it won't warn you if you don't.

const my_dep = b.dependency("my_dep", .{.target = target, .optimize = optimize});
heavy gyro
#

because that's a bad solution, because of what you said just now

violet lagoon
#

I don't think it's a workaround, I think it's the intended method

heavy gyro
#

at times like this I wish target was a built-in thing