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

CMake: Add custom target to build only the generated sources

This is needed so all headers and files exist on disk, so that
the sonar cloud analyzer can find them when executing the compilation
commands contained in compile_commands.json, without actually building.

Co-authored-by: Andrew Kaster <akaster@serenityos.org>
This commit is contained in:
Brian Gianforcaro 2021-08-29 19:27:50 -07:00 committed by Andreas Kling
parent 779cf49f38
commit 619200774b
6 changed files with 32 additions and 0 deletions

View file

@ -15,6 +15,7 @@ function(compile_gml source output string_name)
)
get_filename_component(output_name ${output} NAME)
add_custom_target(generate_${output_name} DEPENDS ${output})
add_dependencies(all_generated generate_${output_name})
endfunction()
function(compile_ipc source output)
@ -30,6 +31,7 @@ function(compile_ipc source output)
)
get_filename_component(output_name ${output} NAME)
add_custom_target(generate_${output_name} DEPENDS ${output})
add_dependencies(all_generated generate_${output_name})
endfunction()
function(generate_state_machine source header)
@ -51,5 +53,6 @@ function(generate_state_machine source header)
MAIN_DEPENDENCY ${source}
)
add_custom_target(${target_name} DEPENDS ${output})
add_dependencies(all_generated ${target_name})
endif()
endfunction()