diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2022-11-09 16:36:14 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-11-24 14:52:00 +0000 |
commit | cfa748807241bddf0f8bb5f18837d87654437271 (patch) | |
tree | 26535b83f5e8eaa6e9233808708e0aad418fd09b /src/android/mm/cros_camera_buffer.cpp | |
parent | 3d612720fb99057f10e21d2069aacdfbbf0f05d1 (diff) |
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>
Diffstat (limited to 'src/android/mm/cros_camera_buffer.cpp')
0 files changed, 0 insertions, 0 deletions