From patchwork Tue Nov 21 14:53:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19217 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 2C12DC328F for ; Tue, 21 Nov 2023 14:54:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DDD99629B6; Tue, 21 Nov 2023 15:53:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1700578439; bh=N5lmsMB0/dZMHFpG1hIvgGUnLo18Jz3E9dr9ei9LXMw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=MUt2C6I8cPQwurIg8CmyI782Eta0pzfjkXpS78vqGoBJQmGs7SMrcKMnbsYgxmmIB i5ZAPmFXuH1Y2U4L2xzAGyGI9ZaHbUrw2IB+tlzfpg+bTRwuZfKBXSl4g5kj6I4k7O u8iA6aP2QtyGL4undublD5N12o1VdRzrZDxFqPgZwXdFWJUYJggyZ2GmBruOJ/bQ+I amnru3OF+mG0tebTM0nMB1fquZK31quaJIyeOHCioVc0TAjKgrYwtmkjzTXdqOKPUD WiDZR24F9E1X128YXp6Zj1opRY9FXfLOHFkTbyKpbUBQrNxVoq3nMjYu+zdajqPEG4 9jpkJC26G87vQ== Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0988261DB0 for ; Tue, 21 Nov 2023 15:53:58 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="bappw0w2"; dkim-atps=neutral Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c876f1e44dso37086441fa.0 for ; Tue, 21 Nov 2023 06:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1700578437; x=1701183237; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S7qLn4hXZgTbdZqaZ5za1br9W0F1gEiccigSkouVflU=; b=bappw0w21IWyohjAk4M8cqZPFObIhMrXfGz19wK50tS9X7JPsAr9vya7eqpRdUEVEP m/NRBrwwqrgeLFJkbxcWeq2FoxOv0+IDMR9XkRUWsuWLbvzQV7wJuQNG89775g/PQdwr L10uPgpvNQhaE29eoLrOiKjv54bPI7Bd4lY2lDQqnrWdBRtJPhstN/4f3B1Fau8wkv4n 02Tue94Oh6/Ibdh/nipp4rq42Eg4YA2usm80hDJU062xfkZDGoicrwDeMLEyMh2wc1a3 wJs6gG+OWCYQXy0dtSsVXfL5F74Sa7BmgQ182BJ+FvoslId84LoI2mf5hQgCl2TgUWrU /uhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700578437; x=1701183237; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S7qLn4hXZgTbdZqaZ5za1br9W0F1gEiccigSkouVflU=; b=j1CLp7LciNU0M8KL5Uak78ZGQe7w0TcueYdhoVBqV7emgqOtnNOU3UzrhuzfeEUHge ZyCcAf4JYAtLSru6MDrZ6sXbImtKpOfWnqB33dq8sMH4zgUte+LkgwxmDmwHZJ4xG6Ep gkZ5UuNWMdyl6lWZMY5H00uCEHpWYvq1GQfH+7xsC2D8ogbpiRDswCkkZ9ZxrLU4OAVn 2aYTZyxTmPSSDaDPBL1K1YtSshWl95x6yNMhJJaXXpW5fXxc/eh/4pqd21NlvCO79XJM 5JlqPjxeFdYytpSEQuR9U+QzqTmlzxojNARzIKpLStQbUHTsdF3Efqq7xEKPOY/0abFS tmbQ== X-Gm-Message-State: AOJu0YxxsUu5cfkjOEVWKLYBJ5Jn65nVpIQ+S5Ai5T94dQ1/HkjG0P2B 9W4Z4wxc3raDDZBggYaIOGuTMnFmEkFUSp2gW4n1qg== X-Google-Smtp-Source: AGHT+IHsL0WCpBIRiqccYe7nLJAcVBYHcJHyCklmls41hzd+UbI6JM93PSG7yR2t+pQJgzLtNlSaqQ== X-Received: by 2002:a2e:b816:0:b0:2c5:2eaa:5399 with SMTP id u22-20020a2eb816000000b002c52eaa5399mr8065086ljo.6.1700578436730; Tue, 21 Nov 2023 06:53:56 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id h18-20020a05600c351200b004063ea92492sm17570968wmq.22.2023.11.21.06.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 06:53:55 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 21 Nov 2023 14:53:46 +0000 Message-Id: <20231121145350.5956-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231121145350.5956-1-naush@raspberrypi.com> References: <20231121145350.5956-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/6] controls: Update argument handling for controls generation scripts 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The template file to the gen-controls.py and gen-py-controls.py is now passed in through the '-t' command line argument instead of being a positional argument. This will allow multiple input files to be provided to the scripts in a future commit. Signed-off-by: Naushir Patuck --- include/libcamera/meson.build | 7 ++++--- src/libcamera/meson.build | 7 ++++--- src/py/libcamera/gen-py-controls.py | 2 +- src/py/libcamera/meson.build | 18 ++++++++---------- utils/gen-controls.py | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 2c8c0258c95e..5fb772e6dd14 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -41,12 +41,13 @@ control_source_files = { control_headers = [] foreach header, mode : control_source_files - input_files = files('../../src/libcamera/' + header +'.yaml', header + '.h.in') + input_files = files('../../src/libcamera/' + header +'.yaml') + template_file = files(header + '.h.in') control_headers += custom_target(header + '_h', input : input_files, output : header + '.h', - command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@', - '--mode', mode], + command : [gen_controls, '-o', '@OUTPUT@', + '--mode', mode, '-t', template_file, '@INPUT@'], install : true, install_dir : libcamera_headers_install_dir) endforeach diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index e49bf850b355..05ee38daf22b 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -128,12 +128,13 @@ endif control_sources = [] foreach source, mode : control_source_files - input_files = files(source +'.yaml', source + '.cpp.in') + input_files = files(source +'.yaml') + template_file = files(source + '.cpp.in') control_sources += custom_target(source + '_cpp', input : input_files, output : source + '.cpp', - command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@', - '--mode', mode]) + command : [gen_controls, '-o', '@OUTPUT@', + '--mode', mode, '-t', template_file, '@INPUT@']) endforeach libcamera_sources += control_sources diff --git a/src/py/libcamera/gen-py-controls.py b/src/py/libcamera/gen-py-controls.py index 8f14cdafe313..ea28f0139f23 100755 --- a/src/py/libcamera/gen-py-controls.py +++ b/src/py/libcamera/gen-py-controls.py @@ -93,7 +93,7 @@ def main(argv): help='Output file name. Defaults to standard output if not specified.') parser.add_argument('input', type=str, help='Input file name.') - parser.add_argument('template', type=str, + parser.add_argument('-t', dest='template', type=str, required=True, help='Template file name.') parser.add_argument('--mode', type=str, required=True, help='Mode is either "controls" or "properties"') diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build index f58c7198ee9e..1c3ea1843ac0 100644 --- a/src/py/libcamera/meson.build +++ b/src/py/libcamera/meson.build @@ -28,29 +28,27 @@ pycamera_sources = files([ # Generate controls -gen_py_controls_input_files = files([ - '../../libcamera/control_ids.yaml', - 'py_controls_generated.cpp.in', -]) +gen_py_controls_input_files = files('../../libcamera/control_ids.yaml') +gen_py_controls_template = files('py_controls_generated.cpp.in') gen_py_controls = files('gen-py-controls.py') pycamera_sources += custom_target('py_gen_controls', input : gen_py_controls_input_files, output : ['py_controls_generated.cpp'], - command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@', '@INPUT@']) + command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@', + '-t', gen_py_controls_template, '@INPUT@']) # Generate properties -gen_py_property_enums_input_files = files([ - '../../libcamera/property_ids.yaml', - 'py_properties_generated.cpp.in', -]) +gen_py_property_enums_input_files = files('../../libcamera/property_ids.yaml') +gen_py_properties_template = files('py_properties_generated.cpp.in') pycamera_sources += custom_target('py_gen_properties', input : gen_py_property_enums_input_files, output : ['py_properties_generated.cpp'], - command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@', '@INPUT@']) + command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@', + '-t', gen_py_properties_template, '@INPUT@']) # Generate formats diff --git a/utils/gen-controls.py b/utils/gen-controls.py index 8f2f8fdb02c3..8af33d29cd07 100755 --- a/utils/gen-controls.py +++ b/utils/gen-controls.py @@ -361,7 +361,7 @@ def main(argv): help='Output file name. Defaults to standard output if not specified.') parser.add_argument('input', type=str, help='Input file name.') - parser.add_argument('template', type=str, + parser.add_argument('-t', dest='template', type=str, required=True, help='Template file name.') parser.add_argument('--mode', type=str, required=True, choices=['controls', 'properties'], help='Mode of operation')