[libcamera-devel] [RFC PATCH] lc-compliance: Disable clang builds

Kieran Bingham kieran.bingham at ideasonboard.com
Thu Sep 9 17:10:27 CEST 2021


On 09/09/2021 16:06, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Thank you for the patch.
> 
> On Thu, Sep 09, 2021 at 04:02:38PM +0100, Kieran Bingham wrote:
>> On distributions with clang and gcc, the gtest library is usually
>> expected to be compiled with gcc. This causes a build failure due
>> to the abi incompatibility.
>>
>> Ideally this would be solved, or detected to be incompatible, but it may
>> not be simple to identify the ABI used for an installed library with
>> meson to check if it is compatible.
>>
>> Restrict lc-compliance to gcc builds only, knowing that if a fully
>> clang-built OS or environment later wants to enable this, a new solution
>> will need to be found.
> 
> This makes it impossible to compile lc-compliance on CrOS, which isn't
> nice :-(

Can it run there? I guess it can as gtest will have been compiled by
clang in that instance.

Any way that we can detect the abi of gtest and only disable if it's
incorrect?

Feels like a minefield :-( but now my clang builds are broken because I
have gtest installed ...

--
Kieran


>> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>> ---
>>  src/lc-compliance/meson.build | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/src/lc-compliance/meson.build b/src/lc-compliance/meson.build
>> index aa5852f6cb87..416405b4e67b 100644
>> --- a/src/lc-compliance/meson.build
>> +++ b/src/lc-compliance/meson.build
>> @@ -8,6 +8,12 @@ if not (libevent.found() and libgtest.found())
>>      subdir_done()
>>  endif
>>  
>> +if cc.get_id() == 'clang'
>> +    lc_compliance_enabled = false
>> +    warning('Disabling lc-compliance on clang due to gtest package incompatibility')
>> +    subdir_done()
>> +endif
>> +
>>  lc_compliance_enabled = true
>>  
>>  lc_compliance_sources = files([
> 


More information about the libcamera-devel mailing list