Skip to content
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

Cannot reference include/opt.zig without copying to src #44

Open
zmenciso opened this issue Feb 25, 2020 · 4 comments
Open

Cannot reference include/opt.zig without copying to src #44

zmenciso opened this issue Feb 25, 2020 · 4 comments

Comments

@zmenciso
Copy link
Contributor

Describe the bug
Cannot find out how to include the opt.zig file with the @import syntax, since Zig thinks the file is out of the scope of the package.

Desktop (please complete the following information):

  • OS: Arch Linux 5.5.2-zen
  • Zig 0.5.0+ab4ea5d3c
@jcharbon-nd jcharbon-nd assigned ghost Mar 4, 2020
@squeek502
Copy link

You might be looking for LibExeObjStep.addPackagePath used in your build.zig (i.e. exe.addPackagePath("opt", "include/opt.zig") would make @import("opt") work for that target).

There's a minimal example of this sort of thing here.

@squeek502
Copy link

Why was this closed?

@sambattalio sambattalio reopened this Apr 17, 2020
@sambattalio
Copy link
Member

Oh oops, I thought it was fixed but I see what you are saying now.

@zmenciso
Copy link
Contributor Author

Yup, this will require some very slight modification to all our src files and the build.exe--pretty straightforward. I might get around to this next week if I have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants