[x265] [PATCH] cmake: switch to c++11 for Clang and GCC

Pradeep Ramachandran pradeep at multicorewareinc.com
Tue May 2 23:15:45 CEST 2017


On Tue, Apr 25, 2017 at 1:25 AM, Mateusz Brzostek <mateusz at msystem.waw.pl>
wrote:

> After tests with GCC from 4.8 to 8.0 I think it is OK to change to c++11
> from c++98 (for -DENABLE_DYNAMIC_HDR10=ON and OFF).
>
> Selur (Hybrid author) wrote that for Clang it should be c++11 instead of
> gnu++11, so we can set for Clang c++11, for GCC gnu++11.
>

I would prefer keeping the default support as c++98 as it will cover a
wider range of applications that may not be compilable with c++11 and may
compile x265 in its build flow.
It is good to see that performance delta is practically zero.


>
> Please review.
>
> # HG changeset patch
> # User Ma0 <mateuszb at poczta.onet.pl>
> # Date 1493108195 -7200
> #      Tue Apr 25 10:16:35 2017 +0200
> # Node ID 0923915cba9cf4bde39d094994469456f1b1f22f
> # Parent  5bc5e73760cdb61d2674e74cc52149fa0603af8a
> cmake: switch to c++11 for Clang and GCC
>
> diff -r 5bc5e73760cd -r 0923915cba9c source/CMakeLists.txt
> --- a/source/CMakeLists.txt    Sat Apr 22 17:00:28 2017 -0700
> +++ b/source/CMakeLists.txt    Tue Apr 25 10:16:35 2017 +0200
> @@ -187,7 +187,11 @@
>  if(GCC)
>      add_definitions(-Wall -Wextra -Wshadow)
>      add_definitions(-D__STDC_LIMIT_MACROS=1)
> -    add_definitions(-std=gnu++98)
> +    if(CLANG)
> +        add_definitions(-std=c++11)
> +    else()
> +        add_definitions(-std=gnu++11)
> +    endif()
>      if(ENABLE_PIC)
>           add_definitions(-fPIC)
>      endif(ENABLE_PIC)
>
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20170502/6ded845d/attachment.html>


More information about the x265-devel mailing list