On 2016-11-06 18:52, René J.V. Bertin wrote:
> I should write out the code to be absolutely certain, but I'm fairly
> sure that the option_proc would look almost exactly the way the
> procedure I described would look.
> 
> Correct? And if so, are there actual advantages to using that more
> advanced approach other than that it uses a few nifty features from
> base?

options are traced, so procs can be called when the variable is read or
modified. For example, the first time an option is read, the default
value will be substituted, which is how we implement the lazy evaluation
of references to other options.

option_proc has the advantage that the value can also still be read in
other parts of the Portfile by accessing a global variable. For a normal
proc, you would need to keep the value in a separate variable.

cmake.generator "ninja"

if {${cmake.generator} eq "ninja"} {
   ...
}

Rainer

Reply via email to