From ff5f59cf246650dc27ea5cd79a84d8e29fc4fca2 Mon Sep 17 00:00:00 2001 From: zdenop Date: Sun, 19 Sep 2021 11:06:19 +0200 Subject: [PATCH] cmake: fix cygwin GNU c++ build; fixes #2379 --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68f06af9..757eb3a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,10 @@ include(CheckCXXCompilerFlag) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) +if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # cygwin gnu c++ needs to use -std=gnu++17 instead of -std=c++17 + set(CMAKE_CXX_EXTENSIONS OFF) +endif () if (BUILD_SHARED_LIBS) set(CMAKE_CXX_VISIBILITY_PRESET hidden)