[webkit-dev] Features defines: Platform.h vs build system

Darin Adler darin at apple.com
Mon Oct 3 07:51:21 PDT 2011


On Oct 3, 2011, at 6:35 AM, Balazs Kelemen wrote:

> I think we lack a consistent way for setting up the set of feature defines. Some of them are handled via Platform.h and some of them via the build systems. Don't you think all should be handled the same way? This has came up in my mind in connection with the newly introduced CSS_FILTERS define. (https://bugs.webkit.org/show_bug.cgi?id=68652) The logic to set the define has only been added to the Mac build system because the feature is Mac-only currently. I don't think it is a good solution. As more platforms would use the feature they also need to add the logic to their build system that is somewhat more difficult than just adding one more ifdef branch to Platform.h. Note that it is not totally avoidable to have some overhead per platform because we need to handle the --css-filters build-webkit switch. However build-webkit already knows how to set up a -D flag on each platform so it's not a big deal.

On the Mac platform, at least, we can build without using the build-webkit script. I would not want to make the build-webkit script required more than it is today.

I believe the base values of feature defines should be controlled by a checked-in source file. Overrides in build scripts would be possible for the unusual situation where someone wants to build with an non-standard set of feature defines for a given platform.

We have never implemented a separate source file that sets each platform’s base values for feature defines. But a while back, Maciej outlined a concept for where to put these platform base include files; I don’t remember when that was or what the details were.

I think that having the defines for all platforms right there in Platform.h or in config.h is absolutely not what we want. Instead we want each high level platform’s base defines to be in a file that is just full of #define statements without a mix of other logic.

    -- Darin



More information about the webkit-dev mailing list