TR1: move TR1 check to config.h / buildsystem

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34729 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2010-06-30 10:53:45 +00:00
parent 103310c401
commit 69036ced37
6 changed files with 12 additions and 37 deletions

View File

@ -28,18 +28,17 @@ 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)
set(LYX_USE_TR1 1)
# GCC <= 4.5 does not support regex: there are linker errors
# http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.tr1
set(LYX_USE_TR1_REGEX 0)
endif()
else()
if(MSVC10)
set(LYX_USE_TR1 1)
set(LYX_USE_TR1_REGEX 1)
add_definitions(-DLYX_USE_TR1)
add_definitions(-DLYX_USE_TR1_REGEX)
endif()
endif()

View File

@ -42,6 +42,10 @@
#cmakedefine USE_MACOSX_PACKAGING 1
#cmakedefine PATH_MAX ${PATH_MAX}
#cmakedefine LYX_USE_TR1 1
#cmakedefine LYX_USE_TR1_REGEX 1
#endif

View File

@ -12,7 +12,7 @@
#ifndef LYX_BIND_H
#define LYX_BIND_H
#include "checktr1.h"
#include "config.h"
#ifdef LYX_USE_TR1

View File

@ -1,28 +0,0 @@
// -*- C++ -*-
/**
* \file checktr1.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Peter Kümmel
*
* Full author contact details are available in file CREDITS.
*/
#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
#if __GNUC__ == 4 && __GNUC_MINOR__ >= 4
#define LYX_USE_TR1
#endif
#endif
#endif

View File

@ -12,7 +12,7 @@
#ifndef LYX_REGEXP_H
#define LYX_REGEXP_H
#include "checktr1.h"
#include "config.h"
#define LYX_REGEX_TO_LYX(X) \

View File

@ -12,7 +12,7 @@
#ifndef LYX_SHARED_PTR_H
#define LYX_SHARED_PTR_H
#include "checktr1.h"
#include "config.h"
#ifdef LYX_USE_TR1