Is there a way to adjust lookup paths for modules during compilation?

Andrey Zherikov andrey.zherikov at gmail.com
Wed Jul 31 18:20:17 UTC 2019


On Wednesday, 31 July 2019 at 17:59:00 UTC, bauss wrote:
> Your best bet is actually not relying on CTFE since IO is very 
> restricted at CTFE in D.
>
> Ex. you can only import files that are specified by you.
>
> The best thing you can do is have a file that lists every file 
> you need to be able to read at CTFE.

I'm not doing IO. I'm looking for something like this:
version(version1) {
  add_import_path("location1");
}
else version(version2) {
  add_import_path("location2");
}

And dozens of other modules that do simple 'import somemodule' 
will get this module from either location1 or location2.


More information about the Digitalmars-d-learn mailing list