events: pass relative paths plus base path to source parser script (#22551)

* events: pass relative paths plus base path to source parser script

to work around maximum Makefile command lenght limits.

* events: correct cmake comment typo

Co-authored-by: Beat Küng <beat-kueng@gmx.net>

---------

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
This commit is contained in:
Matthias Grob 2023-12-18 09:33:53 +01:00 committed by GitHub
parent f38fe24a98
commit 6ffc5a9eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -35,13 +35,21 @@ px4_add_git_submodule(TARGET git_libevents PATH "libevents")
get_property(all_px4_src_files GLOBAL PROPERTY PX4_SRC_FILES)
# Use relative path list to work around Makefile command character limit
set(all_px4_src_files_relative "")
foreach(f ${all_px4_src_files})
file(RELATIVE_PATH relative_path ${PX4_SOURCE_DIR}/src ${f})
list(APPEND all_px4_src_files_relative "${relative_path}")
endforeach(f)
set(generated_events_dir ${PX4_BINARY_DIR}/events)
set(generated_events_px4_file ${generated_events_dir}/px4.json)
set(generated_events_common_enums_file ${generated_events_dir}/common_with_enums.json)
add_custom_command(OUTPUT ${generated_events_px4_file}
COMMAND ${CMAKE_COMMAND} -E make_directory ${generated_events_dir}
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_events.py
--src-path ${all_px4_src_files}
--base-path ${PX4_SOURCE_DIR}/src
--src-path ${all_px4_src_files_relative}
--json ${generated_events_px4_file} #--verbose
DEPENDS
${all_px4_src_files}