[x265] [PATCH] cmake: set '-std=gnu++11' for GCC if ENABLE_DYNAMIC_HDR10 is on

Mateusz Brzostek mateusz at msystem.waw.pl
Thu Apr 20 23:04:03 CEST 2017


Current code for HDR10 needs gnu++11 for GCC at least. This patch sets '-std=gnu++11' for GCC only if
ENABLE_DYNAMIC_HDR10 is set.

Please review.

# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1492721872 -7200
#      Thu Apr 20 22:57:52 2017 +0200
# Node ID 4fb381f7332d4efac82b55bccbbf8de78c622110
# Parent  2c6e6c9c3da72aaddb33565d7031918fb5a37097
cmake: set '-std=gnu++11' for GCC if ENABLE_DYNAMIC_HDR10 is on

diff -r 2c6e6c9c3da7 -r 4fb381f7332d source/CMakeLists.txt
--- a/source/CMakeLists.txt    Thu Apr 20 11:08:02 2017 +0530
+++ b/source/CMakeLists.txt    Thu Apr 20 22:57:52 2017 +0200
@@ -187,7 +187,6 @@
 if(GCC)
     add_definitions(-Wall -Wextra -Wshadow)
     add_definitions(-D__STDC_LIMIT_MACROS=1)
-    add_definitions(-std=gnu++98)
     if(ENABLE_PIC)
          add_definitions(-fPIC)
     endif(ENABLE_PIC)
@@ -371,6 +370,14 @@
     add_definitions(-DENABLE_DYNAMIC_HDR10)
 endif(ENABLE_DYNAMIC_HDR10)
 
+if(GCC)
+    if(ENABLE_DYNAMIC_HDR10)
+        add_definitions(-std=gnu++11)
+    else()
+        add_definitions(-std=gnu++98)
+    endif()
+endif(GCC)
+
 # this option can only be used when linking multiple libx265 libraries
 # together, and some alternate API access method is implemented.
 option(EXPORT_C_API "Implement public C programming interface" ON)

-------------- next part --------------
# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1492721872 -7200
#      Thu Apr 20 22:57:52 2017 +0200
# Node ID 4fb381f7332d4efac82b55bccbbf8de78c622110
# Parent  2c6e6c9c3da72aaddb33565d7031918fb5a37097
cmake: set '-std=gnu++11' for GCC if ENABLE_DYNAMIC_HDR10 is on

diff -r 2c6e6c9c3da7 -r 4fb381f7332d source/CMakeLists.txt
--- a/source/CMakeLists.txt	Thu Apr 20 11:08:02 2017 +0530
+++ b/source/CMakeLists.txt	Thu Apr 20 22:57:52 2017 +0200
@@ -187,7 +187,6 @@
 if(GCC)
     add_definitions(-Wall -Wextra -Wshadow)
     add_definitions(-D__STDC_LIMIT_MACROS=1)
-    add_definitions(-std=gnu++98)
     if(ENABLE_PIC)
          add_definitions(-fPIC)
     endif(ENABLE_PIC)
@@ -371,6 +370,14 @@
     add_definitions(-DENABLE_DYNAMIC_HDR10)
 endif(ENABLE_DYNAMIC_HDR10)
 
+if(GCC)
+    if(ENABLE_DYNAMIC_HDR10)
+        add_definitions(-std=gnu++11)
+    else()
+        add_definitions(-std=gnu++98)
+    endif()
+endif(GCC)
+
 # this option can only be used when linking multiple libx265 libraries
 # together, and some alternate API access method is implemented.
 option(EXPORT_C_API "Implement public C programming interface" ON)


More information about the x265-devel mailing list