[CI] [PATCH v1 1/2] Add compilation test with C++20

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue May 7 22:25:23 CEST 2024


On Tue, May 07, 2024 at 09:15:24PM +0100, Kieran Bingham wrote:
> Quoting Laurent Pinchart (2024-05-07 19:17:55)
> > libcamera currently uses C++17, but we want to prepare for a switch to
> > C++20 in the somehow distant future. Avoid C++20 regressions by adding a
> > compilation test with C++20. Do so with g++ 13, which is the most likely
> > version of g++ to support this newer language version properly.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > ---
> >  gitlab-ci.yml | 15 +++++++++++----
> >  1 file changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> > index 3dcb512525ed..225d929bd2ed 100644
> > --- a/gitlab-ci.yml
> > +++ b/gitlab-ci.yml
> > @@ -185,10 +185,17 @@ build-full:debian:13:
> >    needs:
> >      - job: container-debian:13
> >        artifacts: false
> > -  variables:
> > -    ARCH: amd64
> > -    CC: gcc-13
> > -    CXX: g++-13
> > +  parallel:
> > +    matrix:
> > +      - ARCH: amd64
> > +        CC: gcc-13
> > +        CXX: g++-13
> > +      - ARCH: amd64
> > +        CC: gcc-13
> > +        CXX: g++-13
> > +        MESON_OPTIONS: >-
> > +          ${MESON_ALL_OPTIONS}
> > +          -D cpp_std=c++20
> 
> Sounds good to me, but is there really a need to build with gcc-13
> twice?
> 
> I guess it does still ensure gcc-13 still is valid at C++17, and means
> we can update our C++20 builds to later compilers too sooo

I suppose we could save CPU cycles by compiling for C++20 only in the
gcc 13 test. Do you have a preference ?

> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> 
> >  # Build each commit in the branch individually to detect compilation breakages.
> >  build-history:

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list