mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-30 06:06:48 +00:00
LibWeb: Support generating IDL namespaces
These are similar to prototypes and constructors in that they will now be lazily instantiated when they are first requested.
This commit is contained in:
parent
61ecdbca54
commit
020c2b59c4
Notes:
sideshowbarker
2024-07-17 02:42:21 +09:00
Author: https://github.com/trflynn89
Commit: 020c2b59c4
Pull-request: https://github.com/SerenityOS/serenity/pull/17870
Reviewed-by: https://github.com/linusg
5 changed files with 269 additions and 24 deletions
|
@ -76,20 +76,33 @@ endfunction()
|
|||
function (generate_js_bindings target)
|
||||
set(LIBWEB_INPUT_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
function(libweb_js_bindings class)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_BINDINGS "ITERABLE;GLOBAL" "" "")
|
||||
cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_BINDINGS "NAMESPACE;ITERABLE;GLOBAL" "" "")
|
||||
get_filename_component(basename "${class}" NAME)
|
||||
set(BINDINGS_SOURCES
|
||||
"Bindings/${basename}Constructor.h"
|
||||
"Bindings/${basename}Constructor.cpp"
|
||||
"Bindings/${basename}Prototype.h"
|
||||
"Bindings/${basename}Prototype.cpp"
|
||||
)
|
||||
set(BINDINGS_TYPES
|
||||
constructor-header
|
||||
constructor-implementation
|
||||
prototype-header
|
||||
prototype-implementation
|
||||
)
|
||||
|
||||
# FIXME: Instead of requiring a manual declaration of namespace bindings, we should ask BindingsGenerator if it's a namespace
|
||||
if (LIBWEB_BINDINGS_NAMESPACE)
|
||||
set(BINDINGS_SOURCES
|
||||
"Bindings/${basename}Namespace.h"
|
||||
"Bindings/${basename}Namespace.cpp"
|
||||
)
|
||||
set(BINDINGS_TYPES
|
||||
namespace-header
|
||||
namespace-implementation
|
||||
)
|
||||
else()
|
||||
set(BINDINGS_SOURCES
|
||||
"Bindings/${basename}Constructor.h"
|
||||
"Bindings/${basename}Constructor.cpp"
|
||||
"Bindings/${basename}Prototype.h"
|
||||
"Bindings/${basename}Prototype.cpp"
|
||||
)
|
||||
set(BINDINGS_TYPES
|
||||
constructor-header
|
||||
constructor-implementation
|
||||
prototype-header
|
||||
prototype-implementation
|
||||
)
|
||||
endif()
|
||||
|
||||
# FIXME: Instead of requiring a manual declaration of iterable bindings, we should ask BindingsGenerator if it's iterable
|
||||
if(LIBWEB_BINDINGS_ITERABLE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue