From 879a05ce3f95a2abb3d9c50459e73fdb6094ed19 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 26 Jan 2014 21:49:39 +0100 Subject: improve oqgraph boost check to filter out newer boost versions --- storage/oqgraph/CMakeLists.txt | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'storage/oqgraph') diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 593fced6235..7b110b7de5a 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -11,26 +11,44 @@ IF(MSVC) SET(BOOST_OK 0) ELSE() SET(BOOST_OK 1) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") ENDIF() ELSE() + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing") + STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # See if that works. On old gcc it'll fail because of -fno-rtti CHECK_CXX_SOURCE_COMPILES( " #include #include -int main() { return 0; } +#include + +using namespace boost; +struct VertexInfo { int id; }; + +namespace boost +{ + namespace graph + { + template<> struct internal_vertex_name + { typedef multi_index::member type; }; + } +} + +typedef adjacency_list Graph; +int main() +{ + graph_traits::vertex_descriptor *orig; + Graph *g; + remove_vertex(*orig, *g); + return 0; +} " BOOST_OK) ENDIF() IF(BOOST_OK) ADD_DEFINITIONS(-DHAVE_OQGRAPH) - IF(MSVC) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") - ELSE(MSVC) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing") - STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - ENDIF(MSVC) MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc STORAGE_ENGINE MODULE_ONLY) -- cgit v1.2.1