Thread overview
How to share 'version' info between files
Nov 04, 2005
Dwayne Robinson
Nov 04, 2005
Stewart Gordon
Re: How to share 'version' info - oh well
Nov 04, 2005
Dwayne Robinson
Nov 04, 2005
Georg Wrede
November 04, 2005
How can you share version information between several modules?

I have several switches that I want to set which would be overkill to set all on the command line. So I created a single file that all the others import, which would wonderfully except the compiler ignores version information from other modules. I would love to use 'static if' if not for it being useless at the module level :-|

Anyone solved this problem?

--- config.d ---
version=MMX;
version=FastBlit;
version=...

--- several other files ---
import config;


November 04, 2005
Dwayne Robinson wrote:
> How can you share version information between several modules?
> 
> I have several switches that I want to set which would be overkill to set all on
> the command line. So I created a single file that all the others import, which
> would wonderfully except the compiler ignores version information from other
> modules. I would love to use 'static if' if not for it being useless at the
> module level :-|
> 
> Anyone solved this problem?

The issue cropped up a while back:

http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/11981

A workaround is to have a configuration file and use the @ command line syntax.  For example

----- version.cmd -----
version=qwert
version=yuiop
-----------
dmd @version.cmd module.d

or something like this....

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:- C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y
------END GEEK CODE BLOCK------

My e-mail is valid but not my primary mailbox.  Please keep replies on the 'group where everyone may benefit.
November 04, 2005
>The issue cropped up a while back:
>
>http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/11981
>
>A workaround is to have a configuration file and use the @ command line syntax.  For example
>
>----- version.cmd -----
>version=qwert
>version=yuiop
>-----------
>dmd @version.cmd module.d
>
>or something like this....
>
>Stewart.
Hmm :-| Thank you.

After reading your "version import" suggestion, I really wish that was implemented.

-Dwayne


November 04, 2005
Dwayne Robinson wrote:
>> The issue cropped up a while back:
>> 
>> http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/11981
>> 
>> A workaround is to have a configuration file and use the @ command
>> line syntax.  For example
>> 
>> ----- version.cmd ----- version=qwert version=yuiop ----------- dmd
>> @version.cmd module.d
>> 
>> or something like this....
>> 
>> Stewart.
> 
> Hmm :-| Thank you.
> 
> After reading your "version import" suggestion, I really wish that
> was implemented.

How about declaring constants that are not used _in actual_ code, but which are tested with static ifs?
November 05, 2005
"Georg Wrede" <georg.wrede@nospam.org> wrote in message news:436BEE7B.3090105@nospam.org...
> How about declaring constants that are not used _in actual_ code, but which are tested with static ifs?

Only problem with that is that static ifs can't be used at the module level. :\