]> git.lyx.org Git - features.git/commitdiff
Cmake build: Allow cross-compiling with mingw again
authorKornel Benko <kornel@lyx.org>
Sat, 10 Feb 2018 10:21:08 +0000 (11:21 +0100)
committerKornel Benko <kornel@lyx.org>
Sat, 10 Feb 2018 10:21:08 +0000 (11:21 +0100)
1.) The check for "QT_USES_X11" expects the created application
  to run, but the '.exe' file does not run on linux.
2.) Don't use megered build anymore, it is not faster
  on multi-processor machines anyway

development/cmake/ConfigureChecks.cmake
development/cmake/scripts/xmingw

index d2695b041ad116510eff824a9d4a85e6ba2c5cfc..d998e5b826e8c94d21e055746d6072f83565a7d1 100644 (file)
@@ -240,22 +240,29 @@ if(LYX_USE_QT MATCHES "QT5")
   else()
     set(lyx_qt5_config "QtCore/qconfig.h")
   endif()
-  check_cxx_source_runs(
-    "
-    #include <${lyx_qt5_config}>
-    #include <string>
-    using namespace std;
-    string a(QT_QPA_DEFAULT_PLATFORM_NAME);
-    int main(int argc, char **argv)
-    {
-      if (a.compare(\"xcb\") == 0)
-       return(0);
-      else
-       return 1;
-    }
-    "
-    QT_USES_X11)
-  set(QPA_XCB ${QT_USES_X11})
+  if(WIN32)
+    set(QT_USES_X11 CACHE "Win32 compiled without X11" 0)
+    # The try_run for minngw would not work here anyway
+  else()
+    check_cxx_source_runs(
+      "
+      #include <${lyx_qt5_config}>
+      #include <string>
+      using namespace std;
+      string a(QT_QPA_DEFAULT_PLATFORM_NAME);
+      int main(int argc, char **argv)
+      {
+       if (a.compare(\"xcb\") == 0)
+         return(0);
+       else
+         return 1;
+      }
+      "
+      QT_USES_X11)
+    if(QT_USES_X11)
+      set(QPA_XCB ${QT_USES_X11})
+    endif()
+  endif()
 
   if (Qt5X11Extras_FOUND)
     get_target_property(_x11extra_prop Qt5::X11Extras IMPORTED_CONFIGURATIONS)
index 3051a27ff9884c782a4134a73c56ccde688da4e5..ec287da7c94f16ebbc922f42e0e280016c9b2ca1 100755 (executable)
@@ -98,7 +98,7 @@ checkExitCode
 # build LyX
 #
 
-mergefile=-DLYX_MERGE_FILES=1
+mergefile=-DLYX_MERGE_FILES=0
 #pch=-DLYX_PCH=1
 
 cmake $lyxsrcdir \