You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by th...@apache.org on 2021/03/07 13:49:46 UTC

[avro] branch master updated: Tentative fix for AVRO-2933 avro c++ CMakeList enforces a specific version of C++ instead of letting user CXXFLAGS (#960)

This is an automated email from the ASF dual-hosted git repository.

thiru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 04928ad  Tentative fix for AVRO-2933 avro c++ CMakeList enforces a specific version of C++ instead of letting user CXXFLAGS (#960)
04928ad is described below

commit 04928ad70d7c56f821f0cce2033984874c13f53a
Author: Thomas-Barbier-1A <th...@amadeus.com>
AuthorDate: Sun Mar 7 14:49:36 2021 +0100

    Tentative fix for AVRO-2933 avro c++ CMakeList enforces a specific version of C++ instead of letting user CXXFLAGS (#960)
---
 lang/c++/CMakeLists.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
index 4a1ac66..28a272b 100644
--- a/lang/c++/CMakeLists.txt
+++ b/lang/c++/CMakeLists.txt
@@ -20,6 +20,12 @@ cmake_minimum_required (VERSION 2.6)
 
 set (CMAKE_LEGACY_CYGWIN_WIN32 0)
 
+if (NOT DEFINED CMAKE_CXX_STANDARD)
+    set(CMAKE_CXX_STANDARD 11)
+endif()
+
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
 cmake_policy (SET CMP0042 NEW)
 
 if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
@@ -52,9 +58,6 @@ if (WIN32 AND NOT CYGWIN AND NOT MSYS)
         -DBOOST_IOSTREAMS_DYN_LINK
         -DBOOST_PROGRAM_OPTIONS_DYN_LINK
         -DBOOST_ALL_NO_LIB)
-else()
-# Replease c++11 with c++17 below in case C++ 17 should be used
-    add_definitions(-std=c++11 -fPIC)
 endif()
 
 if (CMAKE_COMPILER_IS_GNUCXX)