From patchwork Sat Mar 7 21:13:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3041 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 301B76193A for ; Sat, 7 Mar 2020 22:13:38 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B3BD924B for ; Sat, 7 Mar 2020 22:13:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583615617; bh=EA1AQM3GJ9TBI5aNvLdZRVrzfFVbOl6cTT7lGygYfSQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tiXhkwhbxVqYhFPZ8zUbuK/Us2THr0nLq1H2WuR1WpXH0hOw6bsogh0gKGzHyzfkx Q0Qw4WoqiDYGfWXms9vYogzybGxuuU3HaQ3thRJHNpyvPJ/kCnXH1HTEPr3cCiB/Fn ZkyvBHW979bVo6GdAVnJ8QXb7fYh7DuuemdHOTRc= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 7 Mar 2020 23:13:20 +0200 Message-Id: <20200307211326.26994-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> References: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/7] include: libcamera: Improve automation of libcamera.h generation 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-List-Received-Date: Sat, 07 Mar 2020 21:13:38 -0000 The gen-header.sh script that generates libcamera.h takes all .h files in the include/libcamera/ directory, and manually adds the generated control_ids.h and version.h. This is fragile, as shown by the failure to add property_ids.h to the list in commit f870591a9bf5 ("libcamera: properties: Add location property"). To avoid future omissions, take all the .h.in files into account to generate libcamera.h. This also fixes the missing property_ids.h. Fixes: f870591a9bf5 ("libcamera: properties: Add location property") Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/gen-header.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/libcamera/gen-header.sh b/include/libcamera/gen-header.sh index 7f7816c9f879..fcb9c5e16d07 100755 --- a/include/libcamera/gen-header.sh +++ b/include/libcamera/gen-header.sh @@ -16,10 +16,11 @@ cat < "$dst_file" EOF -headers=$(for header in "$src_dir"/*.h ; do +headers=$(for header in "$src_dir"/*.h "$src_dir"/*.h.in ; do header=$(basename "$header") + header="${header%.in}" echo "$header" -done ; echo "control_ids.h" ; echo "version.h" | sort) +done | sort) for header in $headers ; do echo "#include " >> "$dst_file" From patchwork Sat Mar 7 21:13:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3042 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 879716193A for ; Sat, 7 Mar 2020 22:13:38 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 140DD5F; Sat, 7 Mar 2020 22:13:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583615618; bh=jZ/kP3uIB2vXSgpE39CJ4oFTiU3Uf96zgAJkmWdQR3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=veOuo5ZD2axwNjxEEWrwzgbo94USth3Ito0nuVJ+acbL0r3wUSMMCAftnHmRDDKm2 IxKG8coaYec6yHsinhHxvj5ys9yti7Bd3PY0wyZUH3UDdKcdUKVERQqdmyPRbEM0at c9fSO/HQhBCzxini83ZMAqSnWCqtbDksxYAiPLP4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 7 Mar 2020 23:13:21 +0200 Message-Id: <20200307211326.26994-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> References: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/7] include: libcamera: meson: Add control headers to the libcamera_api array 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-List-Received-Date: Sat, 07 Mar 2020 21:13:38 -0000 From: Kieran Bingham The libcamera_api array is meant to contain all the headers from the libcamera public API, for the purpose of generating documentation and creating the libcamera_dep dependency. The generated control headers are part of the libcamera public API, and used to be included in the libcamera_api array until commit f870591a9bf5 ("libcamera: properties: Add location property") inadvertently removed them. Add them back. Fixes: f870591a9bf5 ("libcamera: properties: Add location property") Signed-off-by: Kieran Bingham [Split the change out and reworded the commit message] Signed-off-by: Laurent Pinchart --- include/libcamera/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index f47c583cbbc0..88edf620f69e 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -44,6 +44,8 @@ foreach header : control_source_files install_dir : join_paths('include', include_dir)) endforeach +libcamera_api += control_headers + gen_header = files('gen-header.sh') libcamera_h = custom_target('gen-header', From patchwork Sat Mar 7 21:13:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3043 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D86296193A for ; Sat, 7 Mar 2020 22:13:38 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 76B3D24B for ; Sat, 7 Mar 2020 22:13:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583615618; bh=VHFt6gdl5DjmGLg+inD5RHBYmsujb2i8hC2EO4YPxKs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NPXgoNVKK+JyGJDzQ44tvVD7c7M5nJFAhUcPISX9gok0zdfccN55Jmc+vsIBKk3Xs 7A+Elf2iiWs8x4GBEs7ROD214MEGpejfaOExSZWcSHr3xEiJSIv1nLCdBw8PWg2yoM EDXv05ZWH4/BEAJPXJIM/cvNfXqMCwbdSvIOjZpc= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 7 Mar 2020 23:13:22 +0200 Message-Id: <20200307211326.26994-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> References: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 3/7] include: libcamera: meson: Add libcamera.h to the libcamera_api array 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-List-Received-Date: Sat, 07 Mar 2020 21:13:39 -0000 The libcamera_api array is meant to contain all the headers from the libcamera public API, for the purpose of generating documentation and creating the libcamera_dep dependency. libcamera.h is part of the libcamera public API, add it to the array. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/meson.build | 2 ++ src/libcamera/meson.build | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 88edf620f69e..23c01d3837ba 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -55,6 +55,8 @@ libcamera_h = custom_target('gen-header', install : true, install_dir : join_paths('include', include_dir)) +libcamera_api += libcamera_h + version = libcamera_version.split('.') libcamera_version_config = configuration_data() libcamera_version_config.set('LIBCAMERA_VERSION_MAJOR', version[0]) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 88658ac563f7..1b69bc0dee54 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -120,7 +120,7 @@ libcamera = shared_library('camera', build_rpath : '/', dependencies : libcamera_deps) -libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_ipa_api, libcamera_h], +libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_ipa_api], include_directories : libcamera_includes, link_with : libcamera) From patchwork Sat Mar 7 21:13:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3044 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3586062826 for ; Sat, 7 Mar 2020 22:13:39 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C746D9CC for ; Sat, 7 Mar 2020 22:13:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583615618; bh=8+VJnOTs3m7iwGkvU+Jz7ztgj7FTqf4VWAxBW5dNOLg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IBhbxYWedmPFBWT8gEi2nM5ZBiQawB9CghqkCLBxClygssGS5hHDUPjrTip4OtKJE QPwAY2WGbjV/2Wdyl488huLO/Fs1NZOSba6Ab9Pi43eFCY6jqUsx/biTyMlHeS6vVM ZQ1+azVUrlhaqYi4PD0KzlwzLQfXXQWHhKyKih/c= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 7 Mar 2020 23:13:23 +0200 Message-Id: <20200307211326.26994-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> References: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/7] libcamera: Don't unnecessarily link against libatomic 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-List-Received-Date: Sat, 07 Mar 2020 21:13:40 -0000 libatomic provides atomic operations that are also available as compiler built-ins on most platforms. On some platforms (such as Sparc) linking against libatomic is required to use any atomic operation. libcamera links against libatomic if available for that reason. This however makes libcamera link against libatomic even when not required, if libatomic is available. Restrict this to only the cases where libatomic is required with a link test. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- meson.build | 1 + src/libcamera/meson.build | 2 +- src/meson.build | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c6e6a934e54e..a1e455249b0d 100644 --- a/meson.build +++ b/meson.build @@ -24,6 +24,7 @@ libcamera_version = libcamera_git_version.split('+')[0] # Configure the build environment. cc = meson.get_compiler('c') +cxx = meson.get_compiler('cpp') config_h = configuration_data() if cc.has_header_symbol('execinfo.h', 'backtrace') diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 1b69bc0dee54..ac6f597c6188 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -93,7 +93,7 @@ version_cpp = vcs_tag(command : [gen_version, meson.build_root()], libcamera_sources += version_cpp libcamera_deps = [ - cc.find_library('atomic', required: false), + libatomic_dep, cc.find_library('dl'), libudev, dependency('threads'), diff --git a/src/meson.build b/src/meson.build index d818d8b86d93..abf755936f2b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,3 +1,20 @@ +# On some platforms gcc doesn't provide built-ins for atomic operations, +# explicit linking against libatomic is required. +if cxx.links(''' + #include + #include + int main(void) + { + std::atomic u32(0); + std::atomic u64(0); + return u32.load() + u64.load(); + } +''') + libatomic_dep = dependency('', required : false) +else + libatomic_dep = cc.find_library('atomic') +endif + if get_option('android') subdir('android') endif From patchwork Sat Mar 7 21:13:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3045 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 86A30628E3 for ; Sat, 7 Mar 2020 22:13:39 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 241B124B for ; Sat, 7 Mar 2020 22:13:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583615619; bh=eE3vxkBN4uy++1U+mRdUxtwBi3NJVq7SSFIuy5wPS94=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bE0ydD6RabedVazCgyY+0t+Z1PaBlAqeApN008CnDAOxrboptOs/TGK86RBSdSfTn 8fwCkBFjABSxmsyZG+kw+2vtvEF2wWESx5loLwLy7GzUeWUV3UTUr5PBUnxk1CJOVF NY2K9twMm3upr3LNYBHNxfz+T1Rj4bLJr/kICqcQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 7 Mar 2020 23:13:24 +0200 Message-Id: <20200307211326.26994-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> References: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 5/7] cam: Link against libatomic if needed 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-List-Received-Date: Sat, 07 Mar 2020 21:13:40 -0000 The cam application makes use if std::atomic<>, link against libatomic if needed. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/cam/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cam/meson.build b/src/cam/meson.build index 478346c59590..e5cec267e948 100644 --- a/src/cam/meson.build +++ b/src/cam/meson.build @@ -7,5 +7,5 @@ cam_sources = files([ ]) cam = executable('cam', cam_sources, - dependencies : libcamera_dep, + dependencies : [ libatomic_dep, libcamera_dep] , install : true) From patchwork Sat Mar 7 21:13:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3046 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DE69162907 for ; Sat, 7 Mar 2020 22:13:39 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7E2115F for ; Sat, 7 Mar 2020 22:13:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583615619; bh=Zx0RHaXPXMPgr+SfAO1Sutx8mYbZOSirqQQ6DSYeDZU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mqYPD6MbyiYWukPhylJinUjvmsbFqq3DzXCEd48AMbrAvQoFA6Djn6ACJx/QUiRQL xDXwAXP0oFM12cwG+xY2ZjCOGV/SURnA7VpqDPSDwKNajPuaxHtWPqamAiDT4qlQ6z v8cDbU116ItPj3qMJIkuBXnl66kz+wpbPu3yw/eg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 7 Mar 2020 23:13:25 +0200 Message-Id: <20200307211326.26994-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> References: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 6/7] v4l2: v4l2_compat: Use correct libcamera_dep dependency 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-List-Received-Date: Sat, 07 Mar 2020 21:13:40 -0000 The v4l2-compat shared library is declared as depending on libcamera_deps. This is not correct, as libcamera_deps contains the dependencies of libcamera itself. The correct dependency for users of libcamera is libcamera_dep. Fixing this allows dropping libcamera_includes from the list of includes required by v4l2-compat, and libcamera from the link_with list, as they are already contained in libcamera_dep. We however need to add an explicit dependency on libdl which was previously provided by libcamera_deps. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/v4l2/meson.build | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build index 14ee3594747d..91f4170da852 100644 --- a/src/v4l2/meson.build +++ b/src/v4l2/meson.build @@ -5,11 +5,6 @@ v4l2_compat_sources = files([ 'v4l2_compat_manager.cpp', ]) -v4l2_compat_includes = [ - libcamera_includes, - libcamera_internal_includes, -] - v4l2_compat_cpp_args = [ # Meson enables large file support unconditionally, which redirect file # operations to 64-bit versions. This results in some symbols being @@ -21,11 +16,18 @@ v4l2_compat_cpp_args = [ '-fvisibility=hidden', ] +v4l2_compat_deps = [ + cc.find_library('dl'), +] + +v4l2_compat_includes = [ + libcamera_internal_includes, +] + v4l2_compat = shared_library('v4l2-compat', v4l2_compat_sources, name_prefix : '', install : true, - link_with : libcamera, include_directories : v4l2_compat_includes, - dependencies : libcamera_deps, + dependencies : [ libcamera_dep, v4l2_compat_deps ], cpp_args : v4l2_compat_cpp_args) From patchwork Sat Mar 7 21:13:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3047 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 54BBE628E3 for ; Sat, 7 Mar 2020 22:13:40 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CDA9924B; Sat, 7 Mar 2020 22:13:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583615620; bh=Cm5nswTA5+burNLwZAXRR6F5EtulJQGauPiG6I7Pf/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C1oQMa+unUdD4hRrSts+HPPIpBOmmyxgevnL7joObHgWO9ubw3uhjW6uhSFVUGpkd kVBhLSJ5/NXgi6SOlS/myza985jOFQAckW662rLiXpxd/Lz21OMzOIhFMX35tSh4dM FYPEVNUAXtmHT6jQ8lFFmi966q646AZ/tWkw2sO4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 7 Mar 2020 23:13:26 +0200 Message-Id: <20200307211326.26994-8-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> References: <20200307211326.26994-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 7/7] libcamera: Declare dependency on generated headers 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-List-Received-Date: Sat, 07 Mar 2020 21:13:41 -0000 From: Kieran Bingham The control headers are generated automatically by parsing our YAML descriptions, and creating the control headers. These headers are included by internal libcamera source files, but the build system isn't informed of this dependency. This allows a race condition to occur in builds where objects are attempted to be built before the included headers have been generated, resulting in a build failure or, worse, in a successful but incorrect build. Declare a dependency on the control headers for libcamera to ensure that they are built before compiling any object within the libcamera library. Signed-off-by: Kieran Bingham [Split the change out and reworded commit message] Signed-off-by: Laurent Pinchart --- src/libcamera/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index ac6f597c6188..692ca5899f3a 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -97,6 +97,7 @@ libcamera_deps = [ cc.find_library('dl'), libudev, dependency('threads'), + declare_dependency(sources : [control_headers]) ] libcamera_link_with = []