diff options
author | Andreas Kling <kling@serenityos.org> | 2022-08-06 14:51:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-06 00:27:09 +0200 |
commit | b33b426b2e37c92b6feb5cea11e685dc13173bbe (patch) | |
tree | a82a9a78485ed1f1466b0315e4ff39917183b095 | |
parent | 91ed6125fd333293ba2f294b6a92a675da233441 (diff) | |
download | serenity-b33b426b2e37c92b6feb5cea11e685dc13173bbe.zip |
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().
-rw-r--r-- | Meta/CMake/libweb_generators.cmake | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Meta/CMake/libweb_generators.cmake b/Meta/CMake/libweb_generators.cmake index 0e1d091000..3715d3472d 100644 --- a/Meta/CMake/libweb_generators.cmake +++ b/Meta/CMake/libweb_generators.cmake @@ -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 |