Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Building multiple configurations?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-03-23 (01:33)
From: Grant Olson <kgo@g...>
Subject: Re: [Caml-list] Building multiple configurations?
On 3/22/2010 9:13 PM, Yoann Padioleau wrote:
>> I've got a configuration file that's a .ml file.  And I do want it to be
>> an .ml file that gets included at compile time, not some .txt config
>> file that gets read in at runtime.  I'm building two different versions
>> of my app, with two different configurations.
> Why ? Why ? Why not having your app configurable with a txt file
> or some command line flags like every other programs ?

Because it's an elaborate configuration.  I don't want to write an
equally elaborate parser when I've already got ocaml to do that for me.
 I'd rather get a compile-time error than a runtime error if the syntax
is bad.  And the app isn't designed to be user-configured.

>> Basically, I want to do the same thing as a C #ifdef:
>> #ifdef VERSION2
>>   ... include version one
>> #else
>>   ... include version two
>> #endif
> People use that because they want to do different things depending on the architecture, or
> if some dependencies are present or not. Do you have the same requirement here ?

They also use it for things like debug/release build.  But I suppose you
could say that the two configurations have totally different
dependencies for these purposes.

I know what I'm doing is a little weird.  But I have my reasons for
wanting to do it this way.