<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 7, 2014, at 09:36, Maciej Stachowiak <<a href="mailto:mjs@apple.com" class="">mjs@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Aug 6, 2014, at 2:22 PM, Dean Jackson <<a href="mailto:dino@apple.com" class="">dino@apple.com</a>> wrote:<br class=""><br class="">Hi floks,<br class=""><br class="">Things are a bit confusing in the OS X and iOS build configurations because we have both a FeatureDefines.h and a set of .xcconfig files, often defining the same thing, and sometimes inconsistently (or at least I've made the mistake of turning a feature off in one place when the other place turned it back on).<br class=""><br class="">Obviously it would be good to have only one location for feature enabling.<br class=""><br class="">While FeatureDefines.h says "Use this file to list _all_ ENABLE() macros" it also says "The feature defaults in this file are only taken into account if the (port specific) build system has not enabled or disabled a particular feature", which is not true.<br class=""><br class="">My proposal is to stop using FeatureDefines.h for the Apple ports (*) and move completely to .xcconfig files.<span class="Apple-converted-space"> </span><br class=""><br class="">Notes:<br class=""><br class="">- Some scripts launched by Xcode might use the ENABLE_WHATEVER environment variables (which FeatureDefines.h can't provide)<br class=""><br class="">- The xcconfig files will probably have to be of the form ENABLE_WHATEVER=0 to disable a feature, rather than just leaving it blank.<br class=""><br class="">- We'd have to change from #ifdef to #if in places.<br class=""><br class="">- You'd always have to edit 4 files to toggle a feature :(<br class=""><br class="">- Generating the FeatureDefines.xcconfig from FeatureDefines.h might be cool, but we have a fair amount of release-specific logic in there (e.g. only enabled on 10.9).<br class=""><br class="">Is this a terrible idea? Please suggest a better one!<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I’d like to propose the opposite: do all feature configuration in header files, and none in port-specific build system files. .xconfig files have a bunch of disadvantages. They are harder to find, harder to edit (since there are multiple), harder to do conditionals in. It also makes it much harder to figure out the feature flag settings for all ports, and to share common defaults.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">If there are scripts depending on ENABLE flags, we should probably fix that. If the scripts generate source, they could create source files with #ifdefs in them instead of testing the flags themselves. Having scripts produce different sources based on build-time settings is more likely to lead to bad builds and broken dependencies, and should be avoided. I would like to know which scripts actually depend on ENABLE_WHATEVER.</span></div></blockquote><div><br class=""></div>At a quick glance:<br class=""><br class=""></div><div>Source/WebCore/DerivedSources.make contains numerous tests of ENABLE flags which I’d guess could be eliminated as you suggest.</div><div><br class=""></div><div>Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm appears to have at least one test of ENABLE flags, which is an interesting case since we can’t generate these #ifs in to the Objective-C DOM API headers.</div><div><br class=""></div><div>The various CMake files used by other ports also contain a large number of tests of ENABLE flags to add search paths or link against different libraries when particular features are enabled. I’m not sure this can be avoided.</div><br class=""><div class="">The JavaScriptCore Xcode project has script phases that do different work depending on whether or not ENABLE_FTL_JIT is set. It’s not sure this can be avoided.</div><div class=""><br class=""></div><div class="">- Mark</div><div class=""><br class=""></div></body></html>