mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:27:35 +00:00
Everywhere: Rename WrapperGenerator to BindingsGenerator
This code generator no longer creates JS wrappers for platform objects in the old sense, instead they're JS objects internally themselves. Most of what we generate now are prototypes - which can be seen as bindings for the internal C++ methods implementing getters, setters, and methods - as well as object constructors, i.e. bindings for the internal create_with_global_object() method. Also tweak the naming of various CMake glue code existing around this.
This commit is contained in:
parent
4270ede7c4
commit
edfef8e2f5
14 changed files with 219 additions and 219 deletions
|
@ -237,8 +237,8 @@ set(XML_PARSER_DEBUG ON)
|
|||
# set(DEBUG_STATUS_REGISTER ON)
|
||||
# False positive: DEFINE_DEBUG_REGISTER is used to define read/write methods for debug registers.
|
||||
# set(DEFINE_DEBUG_REGISTER ON)
|
||||
# Clogs up build: The WrapperGenerator stuff is run at compile time.
|
||||
# set(WRAPPER_GENERATOR_DEBUG ON)
|
||||
# Clogs up build: The BindingsGenerator stuff is run at compile time.
|
||||
# set(BINDINGS_GENERATOR_DEBUG ON)
|
||||
# Immediately finds violations during boot, shouldn't be discoverable by people who aren't working on fixing.
|
||||
# set(KMALLOC_VERIFY_NO_SPINLOCK_HELD ON)
|
||||
# False positive: CONSOLE_OUT_TO_BOCHS_DEBUG_PORT is a flag for ConsoleDevice, not a feature.
|
||||
|
|
|
@ -90,7 +90,7 @@ function (generate_css_implementation)
|
|||
|
||||
endfunction()
|
||||
|
||||
function (generate_js_wrappers target)
|
||||
function (generate_js_bindings target)
|
||||
|
||||
if (CMAKE_CURRENT_BINARY_DIR MATCHES ".*/LibWeb")
|
||||
# Serenity build
|
||||
|
@ -104,8 +104,8 @@ function (generate_js_wrappers target)
|
|||
SET(LIBWEB_META_PREFIX "Lagom")
|
||||
endif()
|
||||
|
||||
function(libweb_js_wrapper class)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_WRAPPER "ITERABLE" "" "")
|
||||
function(libweb_js_bindings class)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_BINDINGS "ITERABLE" "" "")
|
||||
get_filename_component(basename "${class}" NAME)
|
||||
set(BINDINGS_SOURCES
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}Constructor.h"
|
||||
|
@ -120,8 +120,8 @@ function (generate_js_wrappers target)
|
|||
prototype-implementation
|
||||
)
|
||||
|
||||
# FIXME: Instead of requiring a manual declaration of iterable wrappers, we should ask WrapperGenerator if it's iterable
|
||||
if(LIBWEB_WRAPPER_ITERABLE)
|
||||
# FIXME: Instead of requiring a manual declaration of iterable bindings, we should ask BindingsGenerator if it's iterable
|
||||
if(LIBWEB_BINDINGS_ITERABLE)
|
||||
list(APPEND BINDINGS_SOURCES
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}IteratorPrototype.h"
|
||||
"${LIBWEB_OUTPUT_FOLDER}Bindings/${basename}IteratorPrototype.cpp"
|
||||
|
@ -142,11 +142,11 @@ function (generate_js_wrappers target)
|
|||
list(TRANSFORM include_paths PREPEND -i)
|
||||
add_custom_command(
|
||||
OUTPUT "${bindings_src}"
|
||||
COMMAND "$<TARGET_FILE:Lagom::WrapperGenerator>" "--${bindings_type}" ${include_paths} "${LIBWEB_INPUT_FOLDER}/${class}.idl" "${LIBWEB_INPUT_FOLDER}" > "${bindings_src}.tmp"
|
||||
COMMAND "$<TARGET_FILE:Lagom::BindingsGenerator>" "--${bindings_type}" ${include_paths} "${LIBWEB_INPUT_FOLDER}/${class}.idl" "${LIBWEB_INPUT_FOLDER}" > "${bindings_src}.tmp"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${bindings_src}.tmp" "${bindings_src}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E remove "${bindings_src}.tmp"
|
||||
VERBATIM
|
||||
DEPENDS Lagom::WrapperGenerator
|
||||
DEPENDS Lagom::BindingsGenerator
|
||||
MAIN_DEPENDENCY ${LIBWEB_INPUT_FOLDER}/${class}.idl
|
||||
)
|
||||
endforeach()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue