summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/CMakeLists.txt
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-20 22:09:38 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-21 00:58:55 +0200
commit1ffffa005314c073656b8aa6e70104a1b81114ea (patch)
tree9bdfd0a35d3e3746f59852a0f1dd0854aba0fb67 /Libraries/LibWeb/CMakeLists.txt
parent8d6910b78e13fad09e82152d18a814b9298f3cf1 (diff)
downloadserenity-1ffffa005314c073656b8aa6e70104a1b81114ea.zip
LibWeb: Start generating JS wrappers from (simplified) WebIDL :^)
This patch introduces a hackish but functional IDL parser and uses it to generate the JS bindings for Node and Document. We'll see how far this simple parser takes us. The important thing right now is generating code, not being a perfect IDL parser. :^)
Diffstat (limited to 'Libraries/LibWeb/CMakeLists.txt')
-rw-r--r--Libraries/LibWeb/CMakeLists.txt43
1 files changed, 43 insertions, 0 deletions
diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt
index 086caea7cb..3772bad89a 100644
--- a/Libraries/LibWeb/CMakeLists.txt
+++ b/Libraries/LibWeb/CMakeLists.txt
@@ -1,6 +1,7 @@
set(SOURCES
Bindings/CanvasRenderingContext2DWrapper.cpp
Bindings/DocumentWrapper.cpp
+ Bindings/DocumentWrapper.h
Bindings/ElementWrapper.cpp
Bindings/EventListenerWrapper.cpp
Bindings/EventTargetWrapper.cpp
@@ -12,6 +13,8 @@ set(SOURCES
Bindings/MouseEventWrapper.cpp
Bindings/NavigatorObject.cpp
Bindings/NodeWrapper.cpp
+ Bindings/NodeWrapper.h
+ Bindings/NodeWrapperFactory.cpp
Bindings/WindowObject.cpp
Bindings/Wrappable.cpp
Bindings/XMLHttpRequestConstructor.cpp
@@ -124,6 +127,46 @@ set(GENERATED_SOURCES
)
add_custom_command(
+ OUTPUT Bindings/NodeWrapper.h
+ COMMAND /bin/mkdir -p Bindings
+ COMMAND WrapperGenerator --header ${CMAKE_CURRENT_SOURCE_DIR}/DOM/Node.idl > Bindings/NodeWrapper.h
+ VERBATIM
+ DEPENDS WrapperGenerator
+ MAIN_DEPENDENCY DOM/Node.idl
+)
+add_custom_target(generate_NodeWrapper.h DEPENDS Bindings/NodeWrapper.h)
+
+add_custom_command(
+ OUTPUT Bindings/NodeWrapper.cpp
+ COMMAND /bin/mkdir -p Bindings
+ COMMAND WrapperGenerator --implementation ${CMAKE_CURRENT_SOURCE_DIR}/DOM/Node.idl > Bindings/NodeWrapper.cpp
+ VERBATIM
+ DEPENDS WrapperGenerator
+ MAIN_DEPENDENCY DOM/Node.idl
+)
+add_custom_target(generate_NodeWrapper.cpp DEPENDS Bindings/NodeWrapper.cpp)
+
+add_custom_command(
+ OUTPUT Bindings/DocumentWrapper.h
+ COMMAND /bin/mkdir -p Bindings
+ COMMAND WrapperGenerator --header ${CMAKE_CURRENT_SOURCE_DIR}/DOM/Document.idl > Bindings/DocumentWrapper.h
+ VERBATIM
+ DEPENDS WrapperGenerator
+ MAIN_DEPENDENCY DOM/Document.idl
+)
+add_custom_target(generate_DocumentWrapper.h DEPENDS Bindings/DocumentWrapper.h)
+
+add_custom_command(
+ OUTPUT Bindings/DocumentWrapper.cpp
+ COMMAND /bin/mkdir -p Bindings
+ COMMAND WrapperGenerator --implementation ${CMAKE_CURRENT_SOURCE_DIR}/DOM/Document.idl > Bindings/DocumentWrapper.cpp
+ VERBATIM
+ DEPENDS WrapperGenerator
+ MAIN_DEPENDENCY DOM/Document.idl
+)
+add_custom_target(generate_DocumentWrapper.cpp DEPENDS Bindings/DocumentWrapper.cpp)
+
+add_custom_command(
OUTPUT CSS/PropertyID.h
COMMAND /bin/mkdir -p CSS
COMMAND Generate_CSS_PropertyID_h ${CMAKE_CURRENT_SOURCE_DIR}/CSS/Properties.json > CSS/PropertyID.h