mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
LibWeb: Don't generate Bindings/Forward.h
This is no longer used.
This commit is contained in:
parent
bad44f8fc9
commit
22705e3065
2 changed files with 1 additions and 67 deletions
|
@ -192,7 +192,7 @@ function (generate_js_bindings target)
|
|||
|
||||
function(generate_exposed_interface_files)
|
||||
set(exposed_interface_sources
|
||||
Forward.h IntrinsicDefinitions.cpp
|
||||
IntrinsicDefinitions.cpp
|
||||
DedicatedWorkerExposedInterfaces.cpp DedicatedWorkerExposedInterfaces.h
|
||||
SharedWorkerExposedInterfaces.cpp SharedWorkerExposedInterfaces.h
|
||||
WindowExposedInterfaces.cpp WindowExposedInterfaces.h)
|
||||
|
@ -201,7 +201,6 @@ function (generate_js_bindings target)
|
|||
OUTPUT ${exposed_interface_sources}
|
||||
COMMAND "${CMAKE_COMMAND}" -E make_directory "tmp"
|
||||
COMMAND $<TARGET_FILE:Lagom::GenerateWindowOrWorkerInterfaces> -o "${CMAKE_CURRENT_BINARY_DIR}/tmp" -b "${LIBWEB_INPUT_FOLDER}" ${LIBWEB_ALL_IDL_FILES}
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different tmp/Forward.h "Bindings/Forward.h"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different tmp/IntrinsicDefinitions.cpp "Bindings/IntrinsicDefinitions.cpp"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different tmp/DedicatedWorkerExposedInterfaces.h "Bindings/DedicatedWorkerExposedInterfaces.h"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different tmp/DedicatedWorkerExposedInterfaces.cpp "Bindings/DedicatedWorkerExposedInterfaces.cpp"
|
||||
|
|
|
@ -58,70 +58,6 @@ static Optional<LegacyConstructor> const& lookup_legacy_constructor(IDL::Interfa
|
|||
return s_legacy_constructors.get(interface.name).value();
|
||||
}
|
||||
|
||||
static ErrorOr<void> generate_forwarding_header(StringView output_path, Vector<IDL::Interface&>& exposed_interfaces)
|
||||
{
|
||||
StringBuilder builder;
|
||||
SourceGenerator generator(builder);
|
||||
|
||||
generator.append(R"~~~(
|
||||
#pragma once
|
||||
|
||||
namespace Web::Bindings {
|
||||
)~~~");
|
||||
|
||||
auto add_namespace = [](SourceGenerator& gen, StringView namespace_class) {
|
||||
gen.set("namespace_class", namespace_class);
|
||||
|
||||
gen.append(R"~~~(
|
||||
class @namespace_class@;)~~~");
|
||||
};
|
||||
|
||||
auto add_interface = [](SourceGenerator& gen, StringView prototype_class, StringView constructor_class, Optional<LegacyConstructor> const& legacy_constructor, StringView named_properties_class) {
|
||||
gen.set("prototype_class", prototype_class);
|
||||
gen.set("constructor_class", constructor_class);
|
||||
|
||||
gen.append(R"~~~(
|
||||
class @prototype_class@;
|
||||
class @constructor_class@;)~~~");
|
||||
|
||||
if (legacy_constructor.has_value()) {
|
||||
gen.set("legacy_constructor_class", legacy_constructor->constructor_class);
|
||||
gen.append(R"~~~(
|
||||
class @legacy_constructor_class@;)~~~");
|
||||
}
|
||||
if (!named_properties_class.is_empty()) {
|
||||
gen.set("named_properties_class", named_properties_class);
|
||||
gen.append(R"~~~(
|
||||
class @named_properties_class@;)~~~");
|
||||
}
|
||||
};
|
||||
|
||||
for (auto& interface : exposed_interfaces) {
|
||||
auto gen = generator.fork();
|
||||
|
||||
String named_properties_class;
|
||||
if (interface.extended_attributes.contains("Global") && interface.supports_named_properties()) {
|
||||
named_properties_class = MUST(String::formatted("{}Properties", interface.name));
|
||||
}
|
||||
|
||||
if (interface.is_namespace)
|
||||
add_namespace(gen, interface.namespace_class);
|
||||
else
|
||||
add_interface(gen, interface.prototype_class, interface.constructor_class, lookup_legacy_constructor(interface), named_properties_class);
|
||||
}
|
||||
|
||||
generator.append(R"~~~(
|
||||
|
||||
}
|
||||
)~~~");
|
||||
|
||||
auto generated_forward_path = LexicalPath(output_path).append("Forward.h"sv).string();
|
||||
auto generated_forward_file = TRY(Core::File::open(generated_forward_path, Core::File::OpenMode::Write));
|
||||
TRY(generated_forward_file->write_until_depleted(generator.as_string_view().bytes()));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
static ErrorOr<void> generate_intrinsic_definitions(StringView output_path, Vector<IDL::Interface&>& exposed_interfaces)
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
@ -446,7 +382,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
parsers.append(move(parser));
|
||||
}
|
||||
|
||||
TRY(generate_forwarding_header(output_path, intrinsics));
|
||||
TRY(generate_intrinsic_definitions(output_path, intrinsics));
|
||||
|
||||
TRY(generate_exposed_interface_header("Window"sv, output_path));
|
||||
|
|
Loading…
Reference in a new issue