FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Building but not Building

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 04, 2005 2:29 pm    Post subject: Building but not Building Reply with quote

Suppose I have a source file "TestApp" located in directory test:

test\TestApp.d

Suppose I want to only import a library, something like DUI, into my application:

DUI\def\*
DUI\dui\*
DUI\ddi\*
DUI\dglib\*

where * represents all files in each directory, ie package components of DUI. Thus my app contains import statements for all the files in the library above.

I don't want to compile the DUI library components over and over again every time a I build TestApp because TestApp just needs to see the DUI import files for the definitons; it will link to a prebuilt DUI.lib at the end of it all anyway.

How do I compile TestApp.d with build in such a fashion?

Phobos doesn't get compiled by build everytime an application is built. So I assume there must be a way to keep build from building project library source to. This may relate to the use of the -X switch but the documentation doesn't make it clear how that switch is actually used. Does it ignore directories as well as source files?

Sorry if this is a silly question! Thanks!

-JJR
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Wed May 04, 2005 2:47 pm    Post subject: Re: Building but not Building Reply with quote

JJR wrote:
Suppose I have a source file "TestApp" located in directory test:

test\TestApp.d

Suppose I want to only import a library, something like DUI, into my application:

DUI\def\*
DUI\dui\*
DUI\ddi\*
DUI\dglib\*

where * represents all files in each directory, ie package components of DUI. Thus my app contains import statements for all the files in the library above.

I don't want to compile the DUI library components over and over again every time a I build TestApp because TestApp just needs to see the DUI import files for the definitons; it will link to a prebuilt DUI.lib at the end of it all anyway.

How do I compile TestApp.d with build in such a fashion?

Phobos doesn't get compiled by build everytime an application is built. So I assume there must be a way to keep build from building project library source to. This may relate to the use of the -X switch but the documentation doesn't make it clear how that switch is actually used. Does it ignore directories as well as source files?

Sorry if this is a silly question! Thanks!

-JJR

The -X switch tells Build which packages (directories) and which modules (files) to ignore when it comes to recompiling. It still looks at these files to see what imports they use but it excludes them from being recompiled.

Code:
-XDUI

would make sure that any file path that contained the substring \DUI\ or started with DUI\ or ended with DUI.d would be excluded.

You would still need to tell build that a DUI.lib was needed for linking. That can be done by placing either the DMD ...
Code:
pragma(lib, "DUI.lib");
or the Build variety ...
Code:
version(build) pragma(link, "DUI.lib");
in to your application, or explictly adding it to the Build command line.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 04, 2005 2:51 pm    Post subject: Reply with quote

Perfect! Thanks, Derek!

-JJR
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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