LibWeb: Add a mechanism to opt out of generating instance wrappers
To enable incremental movement towards the removal of DOM object instance wrappers, this patch adds a NO_INSTANCE argument that can be passed to libweb_js_wrapper().
This commit is contained in:
parent
91ed6125fd
commit
b33b426b2e
Notes:
sideshowbarker
2024-07-17 07:29:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b33b426b2e Pull-request: https://github.com/SerenityOS/serenity/pull/14816 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg ✅
1 changed files with 15 additions and 4 deletions
|
@ -106,23 +106,34 @@ function (generate_js_wrappers target)
|
|||
|
||||
function(libweb_js_wrapper class)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_WRAPPER "ITERABLE" "" "")
|
||||
cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_WRAPPER "NO_INSTANCE" "" "")
|
||||
get_filename_component(basename "${class}" NAME)
|
||||
set(BINDINGS_SOURCES
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Wrapper.h"
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Wrapper.cpp"
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Constructor.h"
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Constructor.cpp"
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Prototype.h"
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Prototype.cpp"
|
||||
)
|
||||
set(BINDINGS_TYPES
|
||||
header
|
||||
implementation
|
||||
constructor-header
|
||||
constructor-implementation
|
||||
prototype-header
|
||||
prototype-implementation
|
||||
)
|
||||
if(NOT LIBWEB_WRAPPER_NO_INSTANCE)
|
||||
set(BINDINGS_SOURCES
|
||||
${BINDINGS_SOURCES}
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Wrapper.h"
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Wrapper.cpp"
|
||||
)
|
||||
|
||||
set(BINDINGS_TYPES
|
||||
${BINDINGS_TYPES}
|
||||
header
|
||||
implementation
|
||||
)
|
||||
endif()
|
||||
|
||||
# FIXME: Instead of requiring a manual declaration of iterable wrappers, we should ask WrapperGenerator if it's iterable
|
||||
if(LIBWEB_WRAPPER_ITERABLE)
|
||||
list(APPEND BINDINGS_SOURCES
|
||||
|
|
Loading…
Add table
Reference in a new issue