www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Changing default import path hierarchy

It seems like D compilers automatically add the current directory 
to the list of import paths, and put it at the highest priority. 
I'd like to put `.di` files in a subdirectory and have the 
compiler select those over `.d` files with the same name in the 
current directory, but it doesn't seem like there is any way of 
achieving this currently.

For example, if I have `foo.d` and `di/foo.di`, and I compile 
with `gdc -Idi -I. ...` any `import foo` statement will import 
from `foo.d` instead of `di/foo.di` even though I listed `.` 
after `di` in the list of import paths.

Is there a way to disable the automatic inclusion of `.` in the 
list of default import paths so that I could manually re-add it 
with lower priority? Perhaps a flag named something like 
`-nodefaultinc`? Thanks!
Dec 04 2023