mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
TR1: check in cmake for GCC version, fallback in checktr1.h for other build systems, no support of regex in gcc 4.4
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34728 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f3137da47c
commit
103310c401
@ -27,6 +27,24 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
option(lyxinstall "Build install projects/rules" ON)
|
||||
|
||||
|
||||
if(UNIX)
|
||||
# GCC does not support regex: there are linker errors
|
||||
# http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.tr1
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||
if(GCC_VERSION VERSION_GREATER 4.4)
|
||||
set(LYX_USE_TR1_REGEX 0)
|
||||
add_definitions(-DLYX_USE_TR1)
|
||||
endif()
|
||||
else()
|
||||
if(MSVC10)
|
||||
set(LYX_USE_TR1_REGEX 1)
|
||||
add_definitions(-DLYX_USE_TR1)
|
||||
add_definitions(-DLYX_USE_TR1_REGEX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Supress regeneration
|
||||
@ -328,7 +346,7 @@ if(NOT disable-pch)
|
||||
macro(lyx_add_msvc_pch name_)
|
||||
endmacro()
|
||||
macro(lyx_add_gcc_pch name_)
|
||||
add_definitions(-DLYX_PCH_STL -DLYX_PCH_BOOST -DLYX_PCH_QT4)
|
||||
add_definitions(-DLYX_PCH_STL -DLYX_PCH_BOOST -DLYX_PCH_QT4)
|
||||
ADD_PRECOMPILED_HEADER(${name_} ${CMAKE_BINARY_DIR}/config_pch.cpp ${CMAKE_BINARY_DIR}/config.h.gch)
|
||||
endmacro()
|
||||
endif()
|
||||
@ -479,7 +497,11 @@ if(UseExternalBoost)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "----- Using internal boost. To build with installed version use -DUseExternalBoost:BOOL=ON")
|
||||
set(Lyx_Boost_Libraries boost_signals ${BOOST_REGEX_LIB})
|
||||
if(LYX_USE_TR1_REGEX)
|
||||
set(Lyx_Boost_Libraries boost_signals)
|
||||
else()
|
||||
set(Lyx_Boost_Libraries boost_signals boost_regex)
|
||||
endif()
|
||||
add_definitions(-DBOOST_USER_CONFIG="<config.h>")
|
||||
include_directories(${TOP_SRC_DIR}/boost)
|
||||
add_subdirectory(boost)
|
||||
|
@ -1,16 +1,18 @@
|
||||
# This file is part of LyX, the document processor.
|
||||
# Licence details can be found in the file COPYING.
|
||||
#
|
||||
# Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
|
||||
# Copyright (c) 2010, Peter Kümmel, <syntheticpp@gmx.net>
|
||||
#
|
||||
|
||||
project(boost)
|
||||
|
||||
if(MSVC10)
|
||||
|
||||
if(LYX_USE_TR1_REGEX)
|
||||
message(STATUS "Using TR1 regex")
|
||||
else()
|
||||
add_subdirectory(regex)
|
||||
endif()
|
||||
|
||||
|
||||
add_subdirectory(signals)
|
||||
|
||||
|
@ -21,5 +21,3 @@ lyx_add_path(boost_regex_sources ${TOP_SRC_DIR}/boost/libs/regex/src)
|
||||
|
||||
add_library(boost_regex STATIC ${boost_regex_sources})
|
||||
|
||||
set(BOOST_REGEX_LIB boost_regex CACHE STRING "Boost regex lib" FORCE)
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
#ifndef LYX_CHECKTR1_H
|
||||
#define LYX_CHECKTR1_H
|
||||
|
||||
#ifndef LYX_USE_TR1 // When not set by the build system
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
#define LYX_USE_TR1
|
||||
#endif
|
||||
@ -20,5 +22,7 @@
|
||||
#define LYX_USE_TR1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -33,14 +33,15 @@
|
||||
|
||||
|
||||
|
||||
// TODO: only tested with msvc10
|
||||
#if defined(LYX_USE_TR1) && defined(_MSC_VER)
|
||||
#if defined(LYX_USE_TR1) && defined(LYX_USE_TR1_REGEX)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <regex>
|
||||
#define match_partial _Match_partial // why is match_partial not public?
|
||||
#define match_partial _Match_partial
|
||||
#else
|
||||
#include <tr1/regexp>
|
||||
#include <tr1/regex>
|
||||
// TODO no match_partial in gcc, how to replace?
|
||||
#define match_partial match_default
|
||||
#endif
|
||||
|
||||
namespace lyx
|
||||
|
Loading…
Reference in New Issue
Block a user