From 71a4e6bc7bfcaa15525c9b6970ca2665a9d86d34 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 10 Oct 2016 09:08:48 +0000 Subject: [PATCH] fixed: compilation issues with boost < 1.57 due to c++11 name mangling issues in boost::filesystem, you cannot build a program with c++11 if boost was built for c++03. workaround this by using boost's internal hack to do so, disabling the exposure of c++11 scoped enums which is the cause of the problems. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3491672e0..9b099f575f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,11 @@ else() find_package(Boost 1.44.0 COMPONENTS filesystem date_time system regex REQUIRED) endif() +# Boost < 1.57 has c++11 name mangling issues in boost::filesystem +if(Boost_VERSION VERSION_LESS 105700) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_NO_CXX11_SCOPED_ENUMS") +endif() + ################################################################################ # cotire # Fully automated CMake module for build speedup