[webkit-dev] IDL generation: [Conditional=XXX] vs. #if defined(ENABLE_XXX)

Patrick Gansterer paroga at paroga.com
Sun Jul 3 11:24:04 PDT 2011


Am 03.07.2011 um 17:33 schrieb Alexey Proskuryakov:
> 
>> I see three possible solutions:
>> 1) Always generate all IDL files.
>> 2) Change all [Conditional=XXX] to #if define(ENABLE_XXX).
>> 3) Add the correct #if ENABLE(XXX) around the header includes.
> 
> (1) used to be the preferred solution. It's so much nicer to not have tons of #if checks at the top of cpp files.

IMHO it's not so important how _generated_ files look, because we shouldn't need to open them.

The conditionals support for attributes was added in [1]. [2] is a Qt build fix from the original author and used (1).
[3] fixed build-webkit --minimal with (3).

(1) might simplify the build system, since we don't need condition for the IDL files, but I don't think this is a strong argument since we have the conditions for the implementations (CPP) anyway. On windows (1) also generates many "warning LNK4221: no public symbols found; archive member will be inaccessible" warnings (e.g. see logfiles of WinCE buildbot) and compiling "empty" files (after preprocessor) takes unnecessary time.

After deeper looks into our version history I personally prefer fixing the CodeGenerator (like abarth wrote).

Any opinions about changing all #if define(ENABLE_XXX) in the IDL files to [Conditional=XXX] ?

[1] http://trac.webkit.org/changeset/44116
[2] http://trac.webkit.org/changeset/44126
[3] http://trac.webkit.org/changeset/85868

- Patrick


More information about the webkit-dev mailing list