]> git.lyx.org Git - lyx.git/blobdiff - CMakeLists.txt
Fix text direction of references with XeTeX/bidi
[lyx.git] / CMakeLists.txt
index acaad7c08c3c088742df1d762e39d2d25dd79eb8..f759d8f45bdeb314939bf5e1b75169b24cd2f2c2 100644 (file)
@@ -81,16 +81,12 @@ if(NOT help AND NOT HELP)
       message(FATAL_ERROR "Exiting")
     endif()
   endif()
-  # Enable LTO if supported
+  # Enable LTO if supported and not debugging
   if (POLICY CMP0069)
-    cmake_policy(SET CMP0069 NEW)
-    include(CheckIPOSupported)
-    check_ipo_supported(RESULT result OUTPUT reason LANGUAGES CXX)
-    if(result)
-      message(STATUS "Setting IPO True")
-      set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+    if (LYX_DEBUG)
+      cmake_policy(SET CMP0069 OLD)
     else()
-      message(STATUS "Not setting IPO , result = ${result}, reason = ${reason}")
+      cmake_policy(SET CMP0069 NEW)
     endif()
   endif()
 endif()
@@ -162,13 +158,12 @@ LYX_OPTION(EXTERNAL_HUNSPELL "OFF := Build 3rdparty lib hunspelllib" ON ALL)
 LYX_COMBO(EXTERNAL_MYTHES   "OFF := Build 3rdparty lib mytheslib" AUTO OFF ON)
 
 # GCC specific
-LYX_OPTION(PROFILE              "Build profile version" OFF GCC)
+LYX_OPTION(PROFILE              "Build with options for gprof" OFF GCC)
 LYX_OPTION(EXTERNAL_BOOST       "Use external boost" OFF GCC)
 LYX_OPTION(PROGRAM_SUFFIX       "Append version suffix to binaries" ON GCC)
 LYX_OPTION(DEBUG_GLIBC          "Enable libstdc++ debug mode" OFF GCC)
 LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++ pedantic debug mode" OFF GCC)
 LYX_OPTION(STDLIB_DEBUG         "Use debug stdlib" OFF GCC)
-LYX_OPTION(PROFILE              "Build with options for gprof" OFF GCC)
 
 # MSVC specific
 LYX_OPTION(CONSOLE               "Show console on Windows" ON MSVC)
@@ -291,18 +286,21 @@ if(UNIX OR MINGW)
            #message(STATUS "dumpversion: error = ${_error}, result = ${_err}")
          endif()
          message(STATUS "Using GCC version ${GCC_VERSION}")
-         if(GCC_VERSION VERSION_LESS 4.9)
-                 # Drop support for gcc versions prior to 4.9
-                 message(FATAL_ERROR "gcc >= 4.9 is required.")
+         if(GCC_VERSION VERSION_LESS 4.6)
+               message(FATAL_ERROR "gcc >= 4.6 is required.")
+         elseif(GCC_VERSION VERSION_LESS 4.9)
+               # <regex> in gcc is unusable in versions less than 4.9.0
+               # see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631
+               set(LYX_USE_STD_REGEX 0)
          else()
-                 set(LYX_USE_STD_REGEX 1)
+               set(LYX_USE_STD_REGEX 1)
          endif()
        endif()
        set(LYX_GCC11_MODE "${CXX11_FLAG}")
 else()
-       if(MSVC_VERSION LESS 1915)
-               # Drop support for msvc versions prior to 1915
-               message(FATAL_ERROR "msvc >= 1915 is required.")
+       if(MSVC_VERSION LESS 1900)
+               # Drop support for msvc versions prior to 1900 (Visual Studio 2015)
+               message(FATAL_ERROR "Visual Studio >= 2015 is required.")
                set(LYX_USE_STD_REGEX 0)
        else()
                set(LYX_USE_STD_REGEX 1)
@@ -793,7 +791,7 @@ unset(LYX_PYTHON_EXECUTABLE CACHE)
 unset(PYTHON_VERSION_MAJOR)
 unset(PYTHON_VERSION_MINOR)
 unset(PYTHON_VERSION_STRING)
-find_package(PythonInterp 3.3 QUIET)
+find_package(PythonInterp 3.5 QUIET)
 if(NOT PYTHONINTERP_FOUND)
   unset(PYTHON_EXECUTABLE CACHE)
   find_package(PythonInterp 2.0 REQUIRED)