Cmake build: Prohibit use of external boost if using libstdc++ in debug mode

We are using the compiler falgs _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC
See https://opensource.apple.com/source/gcc/gcc-1640/libstdc++-v3/docs/html/debug.html
This commit is contained in:
Kornel Benko 2020-05-27 11:35:48 +02:00
parent b7cac34d96
commit fc39c3b48b
2 changed files with 13 additions and 12 deletions

View File

@ -191,6 +191,11 @@ if (LYX_ENABLE_VALGRIND_TESTS)
message(FATAL_ERROR "Cannot use valgrind tests, executable valgrind is missing. Please disable LYX_ENABLE_VALGRIND_TESTS")
endif()
endif()
if (LYX_DEBUG_GLIBC OR LYX_DEBUG_GLIBC_PEDANTIC OR LYX_STDLIB_DEBUG)
if (LYX_EXTERNAL_BOOST)
message(FATAL_ERROR "Using external boost not compatible with debug mode for stdlib")
endif()
endif()
if(LYX_DMG)
set(LYX_BUNDLE ON)
@ -676,7 +681,14 @@ else()
message(STATUS "CMAKE_CXX_STANDARD set to ${CMAKE_CXX_STANDARD}")
endif()
if(LYX_STDLIB_DEBUG)
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
else()
if(LYX_DEBUG_GLIBC)
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG")
endif()
if(LYX_DEBUG_GLIBC_PEDANTIC)
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG_PEDANTIC")
endif()
endif()
set(CMAKE_CXX_FLAGS "${LYX_CXX_FLAGS} -fno-strict-aliasing " CACHE STRING "Set CXX flags" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -D_DEBUG" CACHE STRING "Set debug flags" FORCE)
@ -1065,14 +1077,6 @@ if(MSVC)
endif()
if(LYX_DEBUG_GLIBC)
set(_GLIBCXX_DEBUG ON)
endif()
if(LYX_DEBUG_GLIBC_PEDANTIC)
set(_GLIBCXX_DEBUG_PEDANTIC ON)
endif()
# Xcode compiler
if (CMAKE_GENERATOR MATCHES Xcode)
if (XCODE_VERSION VERSION_LESS "5.0")

View File

@ -121,7 +121,4 @@
#define HAVE_MODE_T
#endif
#cmakedefine _GLIBCXX_DEBUG 1
#cmakedefine _GLIBCXX_DEBUG_PEDANTIC 1
#endif