diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index d86e9ab8714..07988c602d0 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -833,6 +833,7 @@ set(GENERATED_SOURCES CSS/DefaultStyleSheetSource.cpp CSS/Enums.cpp CSS/GeneratedCSSStyleProperties.cpp + CSS/GeneratedCSSStyleProperties.idl CSS/Keyword.cpp CSS/MathFunctions.cpp CSS/MediaFeatureID.cpp diff --git a/Meta/CMake/libweb_generators.cmake b/Meta/CMake/libweb_generators.cmake index 9075ad7947f..cf4e5f61c0e 100644 --- a/Meta/CMake/libweb_generators.cmake +++ b/Meta/CMake/libweb_generators.cmake @@ -66,6 +66,7 @@ function (generate_css_implementation) invoke_idl_generator( "GeneratedCSSStyleProperties.cpp" + "GeneratedCSSStyleProperties.idl" Lagom::GenerateCSSStyleProperties "${LIBWEB_INPUT_FOLDER}/CSS/Properties.json" "CSS/GeneratedCSSStyleProperties.h" @@ -122,10 +123,18 @@ function (generate_css_implementation) endif() list(APPEND LIBWEB_ALL_GENERATED_HEADERS ${CSS_GENERATED_HEADERS}) set(LIBWEB_ALL_GENERATED_HEADERS ${LIBWEB_ALL_GENERATED_HEADERS} PARENT_SCOPE) + + set(CSS_GENERATED_IDL + "GeneratedCSSStyleProperties.idl" + ) + list(APPEND LIBWEB_ALL_GENERATED_IDL ${CSS_GENERATED_IDL}) + set(LIBWEB_ALL_GENERATED_IDL ${LIBWEB_ALL_GENERATED_IDL} PARENT_SCOPE) endfunction() function (generate_js_bindings target) set(LIBWEB_INPUT_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}") + set(generated_idl_targets ${LIBWEB_ALL_GENERATED_IDL}) + list(TRANSFORM generated_idl_targets PREPEND "generate_") function(libweb_js_bindings class) cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_BINDINGS "NAMESPACE;ITERABLE;GLOBAL" "" "") get_filename_component(basename "${class}" NAME) @@ -186,6 +195,7 @@ function (generate_js_bindings target) add_custom_target(generate_${basename} DEPENDS ${BINDINGS_SOURCES}) add_dependencies(all_generated generate_${basename}) add_dependencies(${target} generate_${basename}) + add_dependencies(generate_${basename} ${generated_idl_targets}) set(BINDINGS_HEADERS ${BINDINGS_SOURCES}) list(FILTER BINDINGS_HEADERS INCLUDE REGEX "\.h$") @@ -230,6 +240,7 @@ function (generate_js_bindings target) add_custom_target(generate_exposed_interfaces DEPENDS ${exposed_interface_sources}) add_dependencies(all_generated generate_exposed_interfaces) add_dependencies(${target} generate_exposed_interfaces) + add_dependencies(generate_exposed_interfaces ${generated_idl_targets}) list(TRANSFORM exposed_interface_sources PREPEND "${CMAKE_CURRENT_BINARY_DIR}/") set(exposed_interface_headers ${exposed_interface_sources}) diff --git a/Meta/CMake/utils.cmake b/Meta/CMake/utils.cmake index 8407e82259d..90845811e02 100644 --- a/Meta/CMake/utils.cmake +++ b/Meta/CMake/utils.cmake @@ -184,7 +184,7 @@ function(invoke_generator name generator primary_source header implementation) set(CURRENT_LIB_GENERATED ${CURRENT_LIB_GENERATED} PARENT_SCOPE) endfunction() -function(invoke_idl_generator name generator primary_source header implementation idl) +function(invoke_idl_generator cpp_name idl_name generator primary_source header implementation idl) cmake_parse_arguments(invoke_idl_generator "" "" "arguments;dependencies" ${ARGN}) add_custom_command( @@ -198,8 +198,10 @@ function(invoke_idl_generator name generator primary_source header implementatio DEPENDS ${generator} ${invoke_idl_generator_dependencies} "${primary_source}" ) - add_custom_target("generate_${name}" DEPENDS "${header}" "${implementation}" "${idl}") - add_dependencies(all_generated "generate_${name}") + add_custom_target("generate_${cpp_name}" DEPENDS "${header}" "${implementation}" "${idl}") + add_custom_target("generate_${idl_name}" DEPENDS "generate_${cpp_name}") + add_dependencies(all_generated "generate_${cpp_name}") + add_dependencies(all_generated "generate_${idl_name}") list(APPEND CURRENT_LIB_GENERATED "${name}") set(CURRENT_LIB_GENERATED ${CURRENT_LIB_GENERATED} PARENT_SCOPE) endfunction()