-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibExeObjStep.addBuildOption doesn't import the type #3127
Comments
I've just added build option support for arrays/slices of primitives in #10016 But I've been trying to figure out whether there's a good way to support structs/unions in the general case.
|
Due to the way build options currently functions (a seperate package) it cant really handle user types defined within the program itself without the build option package having dependencies on all the packages the LibExeStep depends on. If it did, having const Builder = @import("std").build.Builder;
const MyStruct = @import("src/lib.zig").MyStruct;
pub fn build(b: *Builder) void {
const exe = b.addExecutable("foo", "foo.zig");
exe.addBuildOptionExtended(MyStruct, "option", .{}, "@import(\"root\").MyStruct");
exe.install();
b.default_step.dependOn(&exe.step);
} which would result something like: |
Would that run into problems as |
addBuiltOption
doesn't import the type passed.build.zig
foo.zig
If the type is not one of the built-in types (uX, bool etc.) then an import should be added.
The text was updated successfully, but these errors were encountered: