View previous topic :: View next topic |
Author |
Message |
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed May 04, 2005 2:29 pm Post subject: Building but not Building |
|
|
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 |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Wed May 04, 2005 2:47 pm Post subject: Re: Building but not Building |
|
|
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.
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 |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed May 04, 2005 2:51 pm Post subject: |
|
|
Perfect! Thanks, Derek!
-JJR |
|
Back to top |
|
|
|