From patchwork Fri Mar 6 17:20:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 3005 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 53C0760424 for ; Fri, 6 Mar 2020 18:20:34 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B9D7624B; Fri, 6 Mar 2020 18:20:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583515233; bh=RZofm48yplJuZQcpMPGVFBlcDAK5KEho15wAu/HQT2Q=; h=From:To:Cc:Subject:Date:From; b=niBicXFMAnEPZ0vA/EOCM3ySPJazJlIPuo2GrMMS/AiXmodccGFFpAuSyAPC7L1se ZsM86EK0Q7LRCSdQHLbwZoGQaM04/0xQ7HeuTRCPZQH0RXkSStBBMQ8GRq9bTZI2nD sDVPwUz2gUwXt+RzY9Lp8A7ffPgC8V6HG/zXNsh4= From: Kieran Bingham To: libcamera devel Date: Fri, 6 Mar 2020 17:20:30 +0000 Message-Id: <20200306172030.27791-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] 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: Fri, 06 Mar 2020 17:20:34 -0000 The control headers are generated automatically by parsing our YAML descriptions, and creating the control headers. The headers for the controls can be used directly from within libcamera internal pipeline handlers and core components, but there is no link to ensure that the headers are generated before they are used. As part of updating controls to support properties, the commit f870591a9bf5 ("libcamera: properties: Add location property") also inadvertently moved the generated headers out of the libcamera_api dependency generation. This allowed a race condition to occur in builds where objects are attempted to be built before the API definitions had been generated. Declare a dependency on the headers for libcamera to ensure that they are built before compiling any object within the libcamera library, and re-introduce the headers to the libcamera_api variable. Fixes: f870591a9bf5 ("libcamera: properties: Add location property") Signed-off-by: Kieran Bingham --- include/libcamera/meson.build | 2 ++ src/libcamera/meson.build | 1 + 2 files changed, 3 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', diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 88658ac563f7..cd95fa11534a 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 = []