View mode: basic / threaded / horizontal-split · Log in · Help
October 04, 2005
Re: Compiler import path
"Derek Parnell" <derek@psych.ward> wrote in message 
news:47hs1igvu0zw.wp56t9evi2il.dlg@40tude.net...
> On Tue, 4 Oct 2005 14:06:32 +0100, John C wrote:
>
>> "J C Calvarese" <technocrat7@gmail.com> wrote in message
>> news:dhttm5$199q$1@digitaldaemon.com...
>>> In article <dhtsvk$18c2$1@digitaldaemon.com>, John C says...
>>>>
>>>>"Lars Ivar Igesund" <larsivar@igesund.net> wrote in message
>>>>news:dhtrpf$167r$1@digitaldaemon.com...
>>>>> Yes, but your command line below also compiles example.d. If you want 
>>>>> to
>>>>> only import it in main.d, that is there is no code to be linked in, 
>>>>> just
>>>>> symbols, don't put example.d on the command line at all. If both files
>>>>> must
>>>>> be compiled and linked in, you must do this
>>>>>
>>>>> dmd C:\Projects\test\main.d C:\Projects\test\example.d
>>>>
>>>>Thanks for pointing that out, Lars. I hadn't realised.
>>>>
>>>>So, if -I is only appropriate for importing symbols, then I reckon it
>>>>needs
>>>>another option to specify where to look for code modules, or allow -I to
>>>>do
>>>>that too. My command line is getting ridiculously long...
>>>>
>>>>John.
>>>
>>> Have you tried?
>>>
>>> c:
>>> cd \project\test
>>> dmd main.d example.d
>>
>> Yes, that's what I've been doing till now. But this will only work for 
>> files
>> in the current directory. If I've got files elsewhere (say,
>> C:\AnotherProjectFolder), I need to specify the absolute path.
>>
>> What's worse, DMD doesn't seem to like spaces in paths, even if I use
>> quotes, which is so 1994.
>
> Actually, the D compiler does support spaces in the path, but the linker
> doesn't. The net result is you're still screwed. Walter has stated many
> times that the linker is not going to be updated.

Oh dear.

>
>> Anyone know if the various D build tools supports both of these?
>
> If I'm reading you correctly, you want to say (for instance) ...
>
>   build main.d example.d
>
> and the utility will some how know where on your disk(s) that you have
> stored these files, right? Maybe if you'd accept a compromise ... what if
> you give the utility a list of potential areas you that these files might
> exist, kind like a PATH symbol, and it searches through these. Now that
> feature I can easily put into Build if you want.

I don't expect it to magically read my mind, so I'm willing to specify where 
the tool should look, but just the once. If -I worked for code files, I'd be 
happy. So yeah, a switch specifying a path/multiple paths would be 
desirable. I just don't want to clog up my system environment variables (and 
have to reboot after every change).

>
>> Also, C#-style response-file support would be nice.
>
> I don't know what that is. Can you point me to a specification etc...?

A response file is simply a file that includes command line options, saving 
the tedium of typing them out all the time. Similar to a custom sc.ini file.

So instead of using

   dmd main ..\blah\graphics.d ..\blah\ui.d ..\blah\xml.d 
..\blah\blah.d -of"debug\program.exe" 
program.res -op -inline -debug -g -O -L/EXET:NT -L/SU:windows:5

you have a response file called something like build.rsp with those options 
separated out in a readable format, and on the command line do this:

   build.exe @build.rsp

The MSDN documentation is sparse (http://tinyurl.com/bqt39) but should point 
you in the right direction.

>
> -- 
> Derek Parnell
> Melbourne, Australia
> 4/10/2005 11:25:48 PM
October 04, 2005
Re: Compiler import path
"Derek Parnell" <derek@psych.ward> wrote in message 
news:3hz237k6z1f2$.rdgs4wy4oly6.dlg@40tude.net...
> On Tue, 4 Oct 2005 23:33:01 +1000, Derek Parnell wrote:
>
>
>>> Also, C#-style response-file support would be nice.
>>
>> I don't know what that is. Can you point me to a specification etc...?
>
> Don't bother, I found it myself.
>
> The Build utility already supports the idea of response files. For example
> you can have a file called 'xyz.brf' that contains
>
>  main.d
>  example.d
>  -unittest
>  -w
>
> and use it thus ...
>
>  build @xyz
>
> You can have as many response file specification on the command line as 
> you
> like. The '.brf' is the default extention but you can use anything.
>
> Build also supports another sort of response file. In this case the run
> time options are stored in the Build Configuration file and are used
> primarily for often used combinations of command line switches. For
> example, your configuration file (build.cfg) might look like this ...
>
> CMDLINE=-info           # Show the version of build
> CMDLINE=-Iz:\dlibs
>
> [dbg]
> CMDLINE=-unittest --release --inline -g -w -full
> CMDLINE=-T{Target}_{Group}
>
> [prod]
> CMDLINE=--unittest --debug* --g --w -release -inline -full
> CMDLINE=-T{Target}_{Group}
>
> and you use it thus ...
>
>  build main.d +dbg
>
> in which case, all the CMDLINE options in the unnamed section are used 
> plus
> the ones in the [dbg] section. The {Target} would get replaced with 'main'
> because that's the file used on the command line, and {Group} would get
> replaced with 'dbg' because that's the section that was specified. This
> would make the string '-Tmain_dbg' appear on the dmd command line.
>
> You can mix'n'match the two response file usages on the same command line.
>
> To get the debug edition ...
>  build @xyz +dbg
>
> To get the production edition ...
>  build @xyz +prod
>
> -- 
> Derek Parnell
> Melbourne, Australia
> 4/10/2005 11:45:23 PM

Sounds like what I'm after. I'll give build a whirl. Cheers.
October 04, 2005
Re: Compiler import path
> What's worse, DMD doesn't seem to like spaces in paths, even if I use
> quotes, which is so 1994.

lol

"John C" <johnch_atms@hotmail.com> wrote in message
news:dhtuos$1a6k$1@digitaldaemon.com...
> "J C Calvarese" <technocrat7@gmail.com> wrote in message
> news:dhttm5$199q$1@digitaldaemon.com...
> > In article <dhtsvk$18c2$1@digitaldaemon.com>, John C says...
> >>
> >>"Lars Ivar Igesund" <larsivar@igesund.net> wrote in message
> >>news:dhtrpf$167r$1@digitaldaemon.com...
> >>> Yes, but your command line below also compiles example.d. If you want
to
> >>> only import it in main.d, that is there is no code to be linked in,
just
> >>> symbols, don't put example.d on the command line at all. If both files
> >>> must
> >>> be compiled and linked in, you must do this
> >>>
> >>> dmd C:\Projects\test\main.d C:\Projects\test\example.d
> >>
> >>Thanks for pointing that out, Lars. I hadn't realised.
> >>
> >>So, if -I is only appropriate for importing symbols, then I reckon it
> >>needs
> >>another option to specify where to look for code modules, or allow -I to
> >>do
> >>that too. My command line is getting ridiculously long...
> >>
> >>John.
> >
> > Have you tried?
> >
> > c:
> > cd \project\test
> > dmd main.d example.d
>
> Yes, that's what I've been doing till now. But this will only work for
files
> in the current directory. If I've got files elsewhere (say,
> C:\AnotherProjectFolder), I need to specify the absolute path.
>
> What's worse, DMD doesn't seem to like spaces in paths, even if I use
> quotes, which is so 1994.
>
> Anyone know if the various D build tools supports both of these? Also,
> C#-style response-file support would be nice.
>
> >
> > (This method requires dmd to be in your path, but I think it's worth the
> > effort.)
> >
> > Alternatively, you migtht try using Build
> > (http://www.dsource.org/projects/build/).
> >
> > jcc7
>
>
October 05, 2005
Re: Compiler import path
In article <dhtuos$1a6k$1@digitaldaemon.com>, John C says...
>
>"J C Calvarese" <technocrat7@gmail.com> wrote in message 
>news:dhttm5$199q$1@digitaldaemon.com...
>> In article <dhtsvk$18c2$1@digitaldaemon.com>, John C says...
>>>
>>>"Lars Ivar Igesund" <larsivar@igesund.net> wrote in message
>>>news:dhtrpf$167r$1@digitaldaemon.com...
>>>> Yes, but your command line below also compiles example.d. If you want to
>>>> only import it in main.d, that is there is no code to be linked in, just
>>>> symbols, don't put example.d on the command line at all. If both files
>>>> must
>>>> be compiled and linked in, you must do this
>>>>
>>>> dmd C:\Projects\test\main.d C:\Projects\test\example.d
>>>
>>>Thanks for pointing that out, Lars. I hadn't realised.
>>>
>>>So, if -I is only appropriate for importing symbols, then I reckon it 
>>>needs
>>>another option to specify where to look for code modules, or allow -I to 
>>>do
>>>that too. My command line is getting ridiculously long...
>>>
>>>John.
>>
>> Have you tried?
>>
>> c:
>> cd \project\test
>> dmd main.d example.d
>
>Yes, that's what I've been doing till now. But this will only work for files 
>in the current directory. If I've got files elsewhere (say, 
>C:\AnotherProjectFolder), I need to specify the absolute path.
>
>What's worse, DMD doesn't seem to like spaces in paths, even if I use 
>quotes, which is so 1994.

I suspect you could use the 8-character equivalents, but that might not be
practical. For example, "program files" is usually "progra~1".

dmd c:\progra~1\myfile.d
instead of
dmd "c:\program files\myfile.d"

jcc7
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home