libcamera/utils
Barnabás Pőcze cfa7488072 libcamera: tracing: fix header generation when built as subproject
Building libcamera as a subproject is failing when tracepoints are
enabled due to incorrectly managing the relative paths between the
source and build directory while generating tracepoint headers.

The previously used

  path = output.replace('include/', '', 1)

logic is not sufficient to correctly determine the proper path when
libcamera is built as a subproject, and does not correctly handle the
relative paths, causing path to be processed as:

  'subprojects/libcamera/include/libcamera/internal/tracepoints.h'.replace('include/', '', 1)

which evaluates to

  'subprojects/libcamera/libcamera/internal/tracepoints.h'

so the tracepoints.h header file will try to include:

  #define TRACEPOINT_INCLUDE "subprojects/libcamera/libcamera/internal/tracepoints.h"

which will fail.

Fix it by using Python's pathlib to calculate the relative path of the
output file with respect to the "include" directory of libcamera.

This has been tested with Pipewire. For non-subproject builds it should
generate the exact same path that was previously generated.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
[Kieran: Commit message expanded/reworded]
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-11-24 14:52:00 +00:00
..
hooks utils: hooks: pre-push: Catch commits without author's SoB 2022-03-28 13:29:32 +03:00
ipc utils: ipc: Allow the skipHeader attribute on enums 2022-10-18 18:52:52 +09:00
ipu3 utils: ipu3-pack: Provide a 10-bit bayer packing utility 2022-07-19 21:43:35 +05:30
raspberrypi utils: raspberrypi: ctt: Fix alsc green averaging 2022-10-20 11:40:29 +09:00
rkisp1 utils: rkisp1: gen-csc-table: Add support for inverting the CSC 2022-09-30 22:30:17 +03:00
tracepoints libcamera: tracing: fix header generation when built as subproject 2022-11-24 14:52:00 +00:00
checkstyle.py utils: checkstyle.py: Fix color bleed 2022-06-03 23:35:22 +03:00
gen-controls.py utils: gen-controls: Improve YAML notation for variable-size array controls 2022-10-07 18:28:05 +03:00
gen-formats.py utils: gen-formats: Support big-endian DRM formats 2021-02-01 22:33:55 +02:00
gen-header.sh utils: Convert to pragma once 2021-11-24 12:19:03 +00:00
gen-ipa-priv-key.sh libcamera: ipa: Move key generation to utils 2020-09-24 10:56:22 +01:00
gen-ipa-pub-key.py libcamera: ipa: Move key generation to utils 2020-09-24 10:56:22 +01:00
gen-version.sh build: Preserve upstream git versioning using meson dist 2021-10-19 13:14:54 +03:00
meson.build README, meson: Add dependency on ply and jinja2 for IPA interface generation 2020-11-11 19:23:16 +09:00
release.sh utils: Provide a release script 2022-10-13 12:40:24 +01:00
run-dist.sh build: Preserve upstream git versioning using meson dist 2021-10-19 13:14:54 +03:00
semver utils: semver: Add version helper 2022-10-13 12:40:23 +01:00
update-kernel-headers.sh utils: update-kernel-headers: Update path to intel-ipu3.h 2022-01-03 15:31:12 +02:00
update-mojo.sh utils: update-mojo.sh: Add script for updating mojo 2021-05-26 13:03:12 +09:00