From 4c16038e72b378e5864f12fad607abc071d94c6f Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Fri, 1 Apr 2016 21:42:23 -0700 Subject: [PATCH] Fix build on Cygwin use -std=gnu++11 instead of c++0x on cygwin to avoid error: realpath was not declared in this scope ref http://www.cygwin.com/ml/cygwin/2016-03/msg00005.html --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2edf829b..542bce3b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,8 +80,15 @@ if(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wall -pedantic -Werror -Wextra") elseif(CMAKE_COMPILER_IS_GNUCXX) + if(CYGWIN) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -std=gnu++11") + else(CYGWIN) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -std=c++0x") + endif(CYGWIN) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Werror -Wextra -Werror=shadow") + "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow") if (GCC_VERSION VERSION_GREATER 4.4) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-result -Werror=unused-result")