From patchwork Thu May 1 09:58:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23326 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2455BBE08B for ; Thu, 1 May 2025 09:58:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 360AB68B25; Thu, 1 May 2025 11:58:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RRN3TXR6"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF92C68ADC for ; Thu, 1 May 2025 11:58:22 +0200 (CEST) Received: from pb-laptop.local (185.221.143.50.nat.pool.zt.hu [185.221.143.50]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D01B2741 for ; Thu, 1 May 2025 11:58:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1746093495; bh=ZPIGsVmc754ok3ggX8m8980N3ahxgYkMnJOfzVD2O3A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RRN3TXR6w1prkVTeY7ztZor+yhifrDFnrlJGzjwew0K8CXmFMbx7RqW6Yhij5RgM8 uXzZLUuFe0rlwPcyQtdPocxjlqvXrtyETFJUrO35MLq2r2puWwqOfXVLqztC6gdn7X J0ZrDjke3TiWMrRHfQuoYuuOv3GkYQnztpIG8NaQ= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 2/3] utils: codegen: Make users depend on `controls.py` in meson Date: Thu, 1 May 2025 11:58:17 +0200 Message-ID: <20250501095818.3996419-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250501095818.3996419-1-barnabas.pocze@ideasonboard.com> References: <20250501095818.3996419-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Currently, modifying `controls.py` does not make those build targets dirty that use a script that includes it (e.g. `gen-controls.py`) because meson has no knowledge of this dependency. Add `depend_files` to each `custom_target()` invocation to fix this. Ideally it would be possible to attach this dependency to `gen_controls`, `gen_gst_controls`, etc. objects themselves, so that repetition is avoided, but this does not seem possible at the moment. Signed-off-by: Barnabás Pőcze Acked-by: Kieran Bingham Acked-by: Jacopo Mondi --- include/libcamera/meson.build | 1 + src/gstreamer/meson.build | 1 + src/libcamera/meson.build | 1 + src/py/libcamera/meson.build | 2 ++ utils/codegen/meson.build | 2 ++ 5 files changed, 7 insertions(+) diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 9297f3fa3..30ea76f94 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -90,6 +90,7 @@ foreach mode, entry : controls_map command : [gen_controls, '-o', '@OUTPUT@', '--mode', mode, '-t', template_file, '-r', ranges_file, '@INPUT@'], + depend_files : [py_mod_controls], env : py_build_env, install : true, install_dir : libcamera_headers_install_dir) diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build index 6b7e53b55..fd83e073d 100644 --- a/src/gstreamer/meson.build +++ b/src/gstreamer/meson.build @@ -33,6 +33,7 @@ libcamera_gst_sources += custom_target('gstlibcamera-controls.cpp', output : 'gstlibcamera-controls.cpp', command : [gen_gst_controls, '-o', '@OUTPUT@', '-t', gen_gst_controls_template, '@INPUT@'], + depend_files : [py_mod_controls], env : py_build_env) libcamera_gst_cpp_args = [ diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 800d40807..202db1efe 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -156,6 +156,7 @@ foreach mode, inout_files : controls_mode_files command : [gen_controls, '-o', '@OUTPUT@', '--mode', mode, '-t', template_file, '-r', ranges_file, '@INPUT@'], + depend_files : [py_mod_controls], env : py_build_env) endforeach diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build index 596a203ca..456ee7932 100644 --- a/src/py/libcamera/meson.build +++ b/src/py/libcamera/meson.build @@ -36,6 +36,7 @@ pycamera_sources += custom_target('py_gen_controls', output : ['py_controls_generated.cpp'], command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@', '-t', gen_py_controls_template, '@INPUT@'], + depend_files : [py_mod_controls], env : py_build_env) pycamera_sources += custom_target('py_gen_properties', @@ -43,6 +44,7 @@ pycamera_sources += custom_target('py_gen_properties', output : ['py_properties_generated.cpp'], command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@', '-t', gen_py_controls_template, '@INPUT@'], + depend_files : [py_mod_controls], env : py_build_env) # Generate formats diff --git a/utils/codegen/meson.build b/utils/codegen/meson.build index 904dd66d1..8d1c69086 100644 --- a/utils/codegen/meson.build +++ b/utils/codegen/meson.build @@ -16,4 +16,6 @@ gen_header = files('gen-header.sh') gen_ipa_pub_key = files('gen-ipa-pub-key.py') gen_tracepoints = files('gen-tp-header.py') +py_mod_controls = files('controls.py') + subdir('ipc')