pbui-main icon indicating copy to clipboard operation
pbui-main copied to clipboard

Cannot reference `include/opt.zig` without copying to `src`

Open zmenciso opened this issue 5 years ago • 4 comments

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

zmenciso avatar Feb 25 '20 05:02 zmenciso

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 avatar Mar 07 '20 01:03 squeek502

Why was this closed?

squeek502 avatar Apr 16 '20 22:04 squeek502

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

sambattalio avatar Apr 17 '20 00:04 sambattalio

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.

zmenciso avatar Apr 17 '20 01:04 zmenciso