View previous topic :: View next topic |
Author |
Message |
Gregor
Joined: 05 May 2006 Posts: 72 Location: Portland, OR
|
Posted: Wed Oct 04, 2006 2:49 pm Post subject: Possible bug (or misunderstanding) in source.d |
|
|
I'm trying to use -noautoimport, and it doesn't appear to be working. Basically, with or without that option I ended up with build making object files for everything imported and ultimately including them in the generated library, not just those specified on the commandline. Either I'm misunderstanding what -noautoimport is supposed to do, or it's not working.
I think I traced down the problem. In source.d is the section:
Code: |
// Examine each extracted module file.
if ( (mReferencedImports.length > 0) && (AutoImports() == True))
{
AddRoot( std.path.getDirName(util.pathex.CanonicalPath(mFileName, false)) );
}
foreach(char[] lNextFile; mReferencedImports)
{
|
I believe that the foreach should be in the if - when I placed the code like that, everything worked (with -noautoimport it didn't include the extra object files, without -noautoimport it did). AFAICT the foreach is what's actually causing the recursion and getting everything included.
If I'm misunderstanding -noautoimport's purpose, then is there a flag that will cause it to only build those modules specified on the commandline into the target? |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Wed Oct 04, 2006 7:15 pm Post subject: Re: Possible bug (or misunderstanding) in source.d |
|
|
Gregor wrote: | I'm trying to use -noautoimport, and it doesn't appear to be working. |
By default, the path of any module found on an 'import' statement is added to the list of paths to search for module files. This means that if you had ...
Code: | import abc.def.ghi; |
Build would automatically add "abc/def" as if you had of coded "-Iabc/def" on the command line.
Gregor wrote: | Basically, with or without that option I ended up with build making object files for everything imported and ultimately including them in the generated library, not just those specified on the commandline. Either I'm misunderstanding what -noautoimport is supposed to do, or it's not working.
...
If I'm misunderstanding -noautoimport's purpose, then is there a flag that will cause it to only build those modules specified on the commandline into the target? |
There is no switch to invoke that behaviour (you're the first to ask for it). I'll add it into the next release.
How about "-explicit" so that it will only compile the files on the command line and not compile any imported files - even if they are out of date. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
Gregor
Joined: 05 May 2006 Posts: 72 Location: Portland, OR
|
Posted: Wed Oct 04, 2006 7:27 pm Post subject: |
|
|
Aha! Sorry for the misunderstanding. Yes, the -explicit you described would be perfect.
Many thanks! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|