Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: Conditional compilation

Reply
Thread Tools

Re: Conditional compilation

 
 
Rui Maciel
Guest
Posts: n/a
 
      12-26-2012
Giuliano Bertoletti wrote:

> What I'm wondering is if there's some way to set an extern environment
> variabile and have the compiler read it and use when deciding which
> portion to compile.


That's precisely the reason why a bunch of people have developed tools to
set up automated build scripts. For example, the GNU build system is used
to generate a header file typically named config.h, which is used to set all
the relevant platform-specific info needed in the build process.


Rui Maciel

[1] http://www.gnu.org/savannah-
checkouts/gnu/autoconf/manual/autoconf-2.68/html_node/autoheader-
Invocation.html#autoheader-Invocation
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      12-26-2012
Rui Maciel wrote:
> Giuliano Bertoletti wrote:
>
>> What I'm wondering is if there's some way to set an extern environment
>> variabile and have the compiler read it and use when deciding which
>> portion to compile.

>
> That's precisely the reason why a bunch of people have developed tools to
> set up automated build scripts. For example, the GNU build system is used
> to generate a header file typically named config.h, which is used to set all
> the relevant platform-specific info needed in the build process.


I was about to make the same suggestion.

Autotools also builds makefiles with with the appropriate include paths
and libraries.

--
Ian Collins
 
Reply With Quote
 
 
 
 
Jorgen Grahn
Guest
Posts: n/a
 
      01-03-2013
On Wed, 2012-12-26, Ian Collins wrote:
> Rui Maciel wrote:
>> Giuliano Bertoletti wrote:
>>
>>> What I'm wondering is if there's some way to set an extern environment
>>> variabile and have the compiler read it and use when deciding which
>>> portion to compile.

>>
>> That's precisely the reason why a bunch of people have developed tools to
>> set up automated build scripts. For example, the GNU build system is used
>> to generate a header file typically named config.h, which is used to set all
>> the relevant platform-specific info needed in the build process.

>
> I was about to make the same suggestion.
>
> Autotools also builds makefiles with with the appropriate include paths
> and libraries.


The OP was on Windows though, and IIRC solved his problem using some
Visual Studio thing. I also got the feeling his problems originated in
oddities specific to that environment.

(Saying this partly because I'm no friend of Autotools. Undoubtedly
they are sometimes the right solution, but if you can avoid them IMO
you should. I have managed to do that so far.)

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional compilation in VHDL avishay VHDL 4 08-01-2005 05:57 PM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
Conditional Compilation Directives in aspx file? Praveen Ramesh ASP .Net 2 04-13-2005 03:28 AM
Conditional Compilation Directives in aspx file? Praveen ASP .Net 0 04-12-2005 02:50 PM
Preprocessor conditional compilation variable not being saved Chris P ASP .Net 0 10-28-2003 08:48 PM



Advertisments