From c09a00bf16cbb29cb7fc3dccd4d5a76f7d580a68 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Sat, 19 Dec 2015 09:39:54 +0100 Subject: [PATCH] Expose force the old C++ ABI as a build time flag. --- CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 615348484..4724c4001 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,14 +13,9 @@ endif () string (TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE) -# assuming that Linux and Apple users will have gtk2 built by their installed gcc -if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0) - message(STATUS "Gcc Version >= 5.0 ; adding -D_GLIBCXX_USE_CXX11_ABI=0 to build with Gtk2") - add_definitions (-D_GLIBCXX_USE_CXX11_ABI=0) - # see here : https://gcc.gnu.org/gcc-5/changes.html#libstdcxx - endif() +# We might want to build using the old C++ ABI, even when using a new GCC version +if (USE_OLD_CXX_ABI) + add_definitions (-D_GLIBCXX_USE_CXX11_ABI=0) endif() if (UPPER_CMAKE_BUILD_TYPE STREQUAL "DEBUG")