Cmake build: Detect clang and adapt definition of STD_STRING_USES_COW.

This commit is contained in:
Kornel Benko 2014-12-08 17:43:05 +01:00
parent 1df5d28df5
commit edf22ba723
3 changed files with 14 additions and 3 deletions

View File

@ -259,13 +259,10 @@ if(UNIX OR MINGW)
endif()
set(LYX_GCC11_MODE "${CXX11_FLAG}")
endif()
set(STD_STRING_USES_COW 1)
else()
if(MSVC10)
set(LYX_USE_TR1 1)
#set(LYX_USE_TR1_REGEX 1) #TODO should we use it in ECMAScript mode?
else()
set(STD_STRING_USES_COW 1)
endif()
endif()

View File

@ -126,6 +126,17 @@ check_cxx_source_compiles(
"
LYX_CALLSTACK_PRINTING)
get_filename_component(cxx_base "${CMAKE_CXX_COMPILER}" NAME_WE)
if(cxx_base MATCHES "^clang(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\+\\+)?$")
set(STD_STRING_USES_COW)
else()
if("${MINGW}")
set(STD_STRING_USES_COW)
else()
set(STD_STRING_USES_COW 1)
endif()
endif()
if(LYX_USE_QT MATCHES "QT5")
if (Qt5X11Extras_FOUND)
get_target_property(_x11extra_prop Qt5::X11Extras IMPORTED_CONFIGURATIONS)

View File

@ -60,6 +60,9 @@
// Define if callstack can be printed
#cmakedefine LYX_CALLSTACK_PRINTING 1
// Define if std::string uses copy-on-write
#cmakedefine STD_STRING_USES_COW 1
#cmakedefine Z_PREFIX 1
${Include_used_spellchecker}