generate-api-header.py has worked well enough so far, but there are a few problems: * It cannot expand USE(2022_GLIB_API) because its regex cannot handle underscores, and only handles flag names where all alphabetical characters occur before all numeric characters. The regex should be more permissive * It expands USE(FOO) to WTF_USE_FOO, but only HAVE(FOO) flags should receive the WTF_ prefix * It doesn't handle ENABLE_ at all * It translates FOO(BAR) to FOO_BAR, but we really want it to be translated to "defined(FOO_BAR) && FOO_BAR" because unifdef will ignore any directive that it cannot fully evaluate, leaving unwanted guards in the generated headers.
(In reply to Michael Catanzaro from comment #0) > * It expands USE(FOO) to WTF_USE_FOO, but only HAVE(FOO) flags should > receive the WTF_ prefix This actually doesn't matter, since we control exactly which defines get passed to unifdef, and unifdef is supposed to remove them all. Since our normal build flags are not used, there is no requirement to expand things exactly the same way that the rest of the build would.
Pull request: https://github.com/WebKit/WebKit/pull/5943
Committed 256403@main (40b3dbe8a327): <https://commits.webkit.org/256403@main> Reviewed commits have been landed. Closing PR #5943 and removing active labels.