[webkit-changes] [WebKit/WebKit] 40b3db: [GLib] Improvements for generate-api-header.py

Michael Catanzaro noreply at github.com
Mon Nov 7 07:23:09 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 40b3dbe8a327450d94e245fcb2afccdbf6619dbf
      https://github.com/WebKit/WebKit/commit/40b3dbe8a327450d94e245fcb2afccdbf6619dbf
  Author: Michael Catanzaro <mcatanzaro at redhat.com>
  Date:   2022-11-07 (Mon, 07 Nov 2022)

  Changed paths:
    M Source/WebKit/PlatformGTK.cmake
    M Source/WebKit/PlatformWPE.cmake
    M Source/WebKit/Scripts/glib/generate-api-header.py
    M Source/cmake/OptionsGTK.cmake
    M Source/cmake/OptionsWPE.cmake

  Log Message:
  -----------
  [GLib] Improvements for generate-api-header.py
https://bugs.webkit.org/show_bug.cgi?id=247206

Reviewed by Carlos Garcia Campos.

generate-api-header.py has worked well enough so far, but there are a few problems:

 * It cannot expand ENABLE(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 also doesn't handle ENABLE_ at all.
 * It translates FOO(BAR) to FOO_BAR, but we really want it to be
   "defined(FOO_BAR) && FOO_BAR" because unifdef will ignore any
   directive that it cannot fully evaluate, potentially leaving unwanted
   guards in the generated headers.
 * It expands USE(FOO) to WTF_USE_FOO, but only PLATFORM_ flags should
   receive the WTF_ prefix. This doesn't actually matter because we're
   not using any of the real build flags so it's OK to handle them
   differently than the rest of WebKit, but might as well be
   consistent.

* Source/WebKit/PlatformGTK.cmake:
* Source/WebKit/PlatformWPE.cmake:
* Source/WebKit/Scripts/glib/generate-api-header.py:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Canonical link: https://commits.webkit.org/256403@main




More information about the webkit-changes mailing list