www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to share 'version' info between files

reply Dwayne Robinson <Dwayne_member pathlink.com> writes:
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;
Nov 04 2005
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
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: 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.
Nov 04 2005
parent reply Dwayne Robinson <Dwayne_member pathlink.com> writes:
The issue cropped up a while back:

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.

After reading your "version import" suggestion, I really wish that was implemented. -Dwayne
Nov 04 2005
parent reply Georg Wrede <georg.wrede nospam.org> writes:
Dwayne Robinson wrote:
 The issue cropped up a while back:
 
 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?
Nov 04 2005
parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"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. :\
Nov 04 2005