1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

Meta: Allow specifying additional dependencies with invoke_generator

This commit is contained in:
Timothy Flynn 2022-10-26 15:57:30 -04:00 committed by Andreas Kling
parent e73aeb4cea
commit b5a876e606

View file

@ -178,7 +178,7 @@ function(remove_path_if_version_changed version version_file cache_path)
endfunction()
function(invoke_generator name generator version_file header implementation)
cmake_parse_arguments(invoke_generator "" "" "arguments" ${ARGN})
cmake_parse_arguments(invoke_generator "" "" "arguments;dependencies" ${ARGN})
add_custom_command(
OUTPUT "${header}" "${implementation}"
@ -187,7 +187,7 @@ function(invoke_generator name generator version_file header implementation)
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${implementation}.tmp" "${implementation}"
COMMAND "${CMAKE_COMMAND}" -E remove "${header}.tmp" "${implementation}.tmp"
VERBATIM
DEPENDS ${generator} "${version_file}"
DEPENDS ${generator} ${invoke_generator_dependencies} "${version_file}"
)
add_custom_target("generate_${name}" DEPENDS "${header}" "${implementation}")