Skip to content

@import() should search for paths relative to the root zig file / location zig was invoked #744

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

Closed
zesterer opened this issue Feb 5, 2018 · 1 comment

Comments

@zesterer
Copy link

zesterer commented Feb 5, 2018

I have a fairly complex (or will have soon) codebase. I'd like to be able to copy code across different files in different parts of the project tree without changing all of the import references such that they look like ../../../foo.zig.

It would be really nice if Zig also searched for files relative to either the directory that zig was invoked within or the location of the main Zig file.

Alternatively, it could be possible to use a compiler flag to specify additional root paths to search for Zig imports. Something akin to the -I flag implemented by most C compilers.

@zesterer zesterer changed the title @import() should allow paths relative to the root zig file / location zig was invoked @import() should search for paths relative to the root zig file / location zig was invoked Feb 5, 2018
@andrewrk
Copy link
Member

andrewrk commented Feb 5, 2018

duplicate of #216

@andrewrk andrewrk closed this as completed Feb 5, 2018
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

2 participants