From 15f33d4e7cb1ddca269c111c5f5adb8910137d5e Mon Sep 17 00:00:00 2001 From: Jose Santiago Date: Wed, 13 Oct 2021 02:57:21 -0500 Subject: [PATCH] [build] Fix build with default configuration for GCC <4.7 (#2160) --- CMakeLists.txt | 6 +++++- docs/build/build-options.md | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21478c36a..0bebae3cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,11 @@ endif() # options option(CYGWIN_USE_POSIX "Should the POSIX API be used for cygwin. Ignored if the system isn't cygwin." OFF) -option(ENABLE_CXX11 "Should the c++11 parts (srt-live-transmit) be enabled" ON) +if (CMAKE_CXX_COMPILER_ID MATCHES "^GNU$" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + option(ENABLE_CXX11 "Should the c++11 parts (srt-live-transmit) be enabled" OFF) +else() + option(ENABLE_CXX11 "Should the c++11 parts (srt-live-transmit) be enabled" ON) +endif() option(ENABLE_APPS "Should the Support Applications be Built?" ON) option(ENABLE_EXPERIMENTAL_BONDING "Should the EXPERIMENTAL bonding functionality be enabled?" OFF) option(ENABLE_TESTING "Should the Developer Test Applications be Built?" OFF) diff --git a/docs/build/build-options.md b/docs/build/build-options.md index 938d925d2..d8c1d757a 100644 --- a/docs/build/build-options.md +++ b/docs/build/build-options.md @@ -74,7 +74,7 @@ The `pkg-confg` file (`srt.pc`) will be generated with the `libstdc++` library as a dependency. This may be required in some cases where you have an application written in C which therefore won't link against `libstdc++` by default. -**`--enable-c++11`** (default: ON) +**`--enable-c++11`** (default: ON except for GCC<4.7) Enable compiling in C++11 mode for those parts that may require it. Parts that don't require it will still be compiled in C++03 mode,