Cygwin needs "-std=gnu++11" instead. Fixes #150. Change-Id: Id067989ee58bc35c3f59a55b65f54f6e216166c1 Reviewed-on: https://code-review.googlesource.com/14570 Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt index dd302a4..3e22472 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -29,6 +29,9 @@ # CMake defaults to /W3, but some users like /W4 (or /Wall) and /WX, # so we disable various warnings that aren't particularly helpful. add_compile_options(/wd4100 /wd4201 /wd4456 /wd4457 /wd4702 /wd4815) +elseif(CYGWIN OR MINGW) + # See https://stackoverflow.com/questions/38139631 for details. + add_compile_options(-std=gnu++11) elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") add_compile_options(-std=c++11) endif()