April 23, 2014 [Issue 12629] New: Adjust search path according to module name | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12629 Issue ID: 12629 Summary: Adjust search path according to module name Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: DMD Assignee: nobody@puremagic.com Reporter: thecybershadow@gmail.com Consider a project with the following structure: a/b/foo.d: module a.b.foo; a/b/bar.d: module a.b.bar; import a.b.foo; If you run: ~ $ cd a/b ~/a/b $ dmd bar.d DMD will fail to compile, because it will not look for "a/b/foo.d" from the project root. I propose the following enhancement: Implicitly add the package root, according to the module declaration, to the search path. For example, if the file contains the line "module a.b.foo;", add "../.." to the search path. This will allow to compile modules or run D programs located in packages by simply associating .d files with the compiler, with no further configuration. -- |
Copyright © 1999-2021 by the D Language Foundation