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

Mateusz Brzostek mateusz at msystem.waw.pl
Tue Apr 25 10:25:34 CEST 2017


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.

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)

-------------- next part --------------
# 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)


More information about the x265-devel mailing list