From 41e8ab53835eb599243856001adbeb314f106658 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Wed, 27 Jun 2018 17:47:22 +0300 Subject: [PATCH] Limit tampering with standard C++ library to Linux Otherwise it breaks e.g. FreeBSD build where it is not needed at all --- build/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index bed5ee10..73e76ae0 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -202,9 +202,11 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif () elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # more tweaks - if (NOT (MSVC OR MSYS OR APPLE)) + if (LINUX) set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -stdlib=libstdc++" ) # required for list(APPEND CMAKE_REQUIRED_LIBRARIES "stdc++") # required to link with -stdlib=libstdc++ + endif() + if (NOT (MSVC OR MSYS OR APPLE)) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-const-variable -Wno-overloaded-virtual -Wno-c99-extensions" ) endif() endif ()