Kimmo Varis avatar Kimmo Varis committed 43b317c

Fix building with Qt Creator in Windows (ticket #1).

The problem was that LibXDiff project file selected Windows MSVC config file for
the Qt Creator which uses GCC. This commit adds detection for using GCC compiler
in Windows and uses GCC config in that case.

Comments (0)

Files changed (1)

ext/libxdiff/libxdiff.pro

            xdiff/xutils.c \
            xdiff/xversion.c
 
+# For configuration file selection we need to detect these three cases:
+# 1. Windows with MSVC compiler
+# 2. Windows with GCC compiler (and MinGW?)
+# 3. Linux/Unix
+# Since 1. uses Windows MSVC config and 2. and 3. uses GCC config
 win32 {
-    HEADERS += winconfig.h
-    DEFINES += HAVE_WINCONFIG_H
-    
+    contains(QMAKE_CC, gcc){
+        # MingW
+        HEADERS += config.h
+        DEFINES += HAVE_CONFIG_H
+    }
+    contains(QMAKE_CC, cl){
+        # Visual Studio
+        HEADERS += winconfig.h
+        DEFINES += HAVE_WINCONFIG_H
+    }
 }
 unix {
     HEADERS += config.h
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.