LibWeb: Add CMake dependencies for GeneratedCSSStyleProperties.idl

Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
This commit is contained in:
Luke Wilde 2024-11-15 14:46:52 +00:00 committed by Andrew Kaster
parent e5d71a6c82
commit c0ae3aa884
Notes: github-actions[bot] 2024-11-15 23:17:40 +00:00
3 changed files with 17 additions and 3 deletions

View file

@ -833,6 +833,7 @@ set(GENERATED_SOURCES
CSS/DefaultStyleSheetSource.cpp CSS/DefaultStyleSheetSource.cpp
CSS/Enums.cpp CSS/Enums.cpp
CSS/GeneratedCSSStyleProperties.cpp CSS/GeneratedCSSStyleProperties.cpp
CSS/GeneratedCSSStyleProperties.idl
CSS/Keyword.cpp CSS/Keyword.cpp
CSS/MathFunctions.cpp CSS/MathFunctions.cpp
CSS/MediaFeatureID.cpp CSS/MediaFeatureID.cpp

View file

@ -66,6 +66,7 @@ function (generate_css_implementation)
invoke_idl_generator( invoke_idl_generator(
"GeneratedCSSStyleProperties.cpp" "GeneratedCSSStyleProperties.cpp"
"GeneratedCSSStyleProperties.idl"
Lagom::GenerateCSSStyleProperties Lagom::GenerateCSSStyleProperties
"${LIBWEB_INPUT_FOLDER}/CSS/Properties.json" "${LIBWEB_INPUT_FOLDER}/CSS/Properties.json"
"CSS/GeneratedCSSStyleProperties.h" "CSS/GeneratedCSSStyleProperties.h"
@ -122,10 +123,18 @@ function (generate_css_implementation)
endif() endif()
list(APPEND LIBWEB_ALL_GENERATED_HEADERS ${CSS_GENERATED_HEADERS}) list(APPEND LIBWEB_ALL_GENERATED_HEADERS ${CSS_GENERATED_HEADERS})
set(LIBWEB_ALL_GENERATED_HEADERS ${LIBWEB_ALL_GENERATED_HEADERS} PARENT_SCOPE) 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() endfunction()
function (generate_js_bindings target) function (generate_js_bindings target)
set(LIBWEB_INPUT_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}") 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) function(libweb_js_bindings class)
cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_BINDINGS "NAMESPACE;ITERABLE;GLOBAL" "" "") cmake_parse_arguments(PARSE_ARGV 1 LIBWEB_BINDINGS "NAMESPACE;ITERABLE;GLOBAL" "" "")
get_filename_component(basename "${class}" NAME) get_filename_component(basename "${class}" NAME)
@ -186,6 +195,7 @@ function (generate_js_bindings target)
add_custom_target(generate_${basename} DEPENDS ${BINDINGS_SOURCES}) add_custom_target(generate_${basename} DEPENDS ${BINDINGS_SOURCES})
add_dependencies(all_generated generate_${basename}) add_dependencies(all_generated generate_${basename})
add_dependencies(${target} generate_${basename}) add_dependencies(${target} generate_${basename})
add_dependencies(generate_${basename} ${generated_idl_targets})
set(BINDINGS_HEADERS ${BINDINGS_SOURCES}) set(BINDINGS_HEADERS ${BINDINGS_SOURCES})
list(FILTER BINDINGS_HEADERS INCLUDE REGEX "\.h$") 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_custom_target(generate_exposed_interfaces DEPENDS ${exposed_interface_sources})
add_dependencies(all_generated generate_exposed_interfaces) add_dependencies(all_generated generate_exposed_interfaces)
add_dependencies(${target} 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}/") list(TRANSFORM exposed_interface_sources PREPEND "${CMAKE_CURRENT_BINARY_DIR}/")
set(exposed_interface_headers ${exposed_interface_sources}) set(exposed_interface_headers ${exposed_interface_sources})

View file

@ -184,7 +184,7 @@ function(invoke_generator name generator primary_source header implementation)
set(CURRENT_LIB_GENERATED ${CURRENT_LIB_GENERATED} PARENT_SCOPE) set(CURRENT_LIB_GENERATED ${CURRENT_LIB_GENERATED} PARENT_SCOPE)
endfunction() 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}) cmake_parse_arguments(invoke_idl_generator "" "" "arguments;dependencies" ${ARGN})
add_custom_command( 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}" DEPENDS ${generator} ${invoke_idl_generator_dependencies} "${primary_source}"
) )
add_custom_target("generate_${name}" DEPENDS "${header}" "${implementation}" "${idl}") add_custom_target("generate_${cpp_name}" DEPENDS "${header}" "${implementation}" "${idl}")
add_dependencies(all_generated "generate_${name}") 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}") list(APPEND CURRENT_LIB_GENERATED "${name}")
set(CURRENT_LIB_GENERATED ${CURRENT_LIB_GENERATED} PARENT_SCOPE) set(CURRENT_LIB_GENERATED ${CURRENT_LIB_GENERATED} PARENT_SCOPE)
endfunction() endfunction()