Title: [99676] trunk/Tools
Revision
99676
Author
[email protected]
Date
2011-11-09 02:37:31 -0800 (Wed, 09 Nov 2011)

Log Message

[Qt] Centralize duplicated code for linking the static libs

Reviewed by Tor Arne Vestbø.

* qmake/mkspecs/features/functions.prf:
* qmake/mkspecs/features/_javascript_core.prf:
* qmake/mkspecs/features/webcore.prf:
* qmake/mkspecs/features/webkit2.prf:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (99675 => 99676)


--- trunk/Tools/ChangeLog	2011-11-09 10:18:04 UTC (rev 99675)
+++ trunk/Tools/ChangeLog	2011-11-09 10:37:31 UTC (rev 99676)
@@ -1,5 +1,16 @@
 2011-11-09  Simon Hausmann  <[email protected]>
 
+        [Qt] Centralize duplicated code for linking the static libs
+
+        Reviewed by Tor Arne Vestbø.
+
+        * qmake/mkspecs/features/functions.prf:
+        * qmake/mkspecs/features/_javascript_core.prf:
+        * qmake/mkspecs/features/webcore.prf:
+        * qmake/mkspecs/features/webkit2.prf:
+
+2011-11-09  Simon Hausmann  <[email protected]>
+
         [Qt] Build system cleanup
         https://bugs.webkit.org/show_bug.cgi?id=71815
 

Modified: trunk/Tools/qmake/mkspecs/features/functions.prf (99675 => 99676)


--- trunk/Tools/qmake/mkspecs/features/functions.prf	2011-11-09 10:18:04 UTC (rev 99675)
+++ trunk/Tools/qmake/mkspecs/features/functions.prf	2011-11-09 10:37:31 UTC (rev 99676)
@@ -224,3 +224,32 @@
 
     return(true)
 }
+
+defineTest(linkStaticLibrary) {
+    unset(path)
+    unset(target)
+
+    path = $$1
+    target = $$2
+
+    LIBS = -l$$target
+
+    win32-msvc*|wince*|win32-icc {
+        LIBS = -L$$path $$LIBS
+        POST_TARGETDEPS += $${path}$${QMAKE_DIR_SEP}$${target}.lib
+    } else {
+        QMAKE_LIBDIR = $$path $$QMAKE_LIBDIR
+        POST_TARGETDEPS += $${path}$${QMAKE_DIR_SEP}lib$${target}.a
+    }
+
+    # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies.
+    # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit
+    # statically in applications (which isn't used often because, among other things, of licensing obstacles).
+    CONFIG -= explicitlib
+    CONFIG -= staticlib
+
+    export(LIBS)
+    export(QMAKE_LIBDIR)
+    export(POST_TARGETDEPS)
+    export(CONFIG)
+}

Modified: trunk/Tools/qmake/mkspecs/features/_javascript_core.prf (99675 => 99676)


--- trunk/Tools/qmake/mkspecs/features/_javascript_core.prf	2011-11-09 10:18:04 UTC (rev 99675)
+++ trunk/Tools/qmake/mkspecs/features/_javascript_core.prf	2011-11-09 10:37:31 UTC (rev 99676)
@@ -76,28 +76,11 @@
 
 config_step {
     pathToJavaScriptCoreOutput = $$buildDirForSource(Source/_javascript_Core)/$$_javascript_CORE_DESTDIR
+    linkStaticLibrary($$pathToJavaScriptCoreOutput, $$_javascript_CORE_TARGET)
 
-    win32-msvc*|wince*|win32-icc {
-        LIBS = -l$$_javascript_CORE_TARGET $$LIBS
-        LIBS = -L$$pathToJavaScriptCoreOutput $$LIBS
-        POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${_javascript_CORE_TARGET}.lib
-    } else {
-        # Make sure jscore will be early in the list of libraries to workaround a bug in MinGW
-        # that can't resolve symbols from QtCore if libjscore comes after.
-        QMAKE_LIBDIR = $$pathToJavaScriptCoreOutput $$QMAKE_LIBDIR
-        LIBS = -l$$_javascript_CORE_TARGET $$LIBS
-        POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}lib$${_javascript_CORE_TARGET}.a
-    }
-
     win32-* {
         LIBS += -lwinmm
     }
-
-    # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies.
-    # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit
-    # statically in applications (which isn't used often because, among other things, of licensing obstacles).
-    CONFIG -= explicitlib
-    CONFIG -= staticlib
 }
 
 

Modified: trunk/Tools/qmake/mkspecs/features/webcore.prf (99675 => 99676)


--- trunk/Tools/qmake/mkspecs/features/webcore.prf	2011-11-09 10:18:04 UTC (rev 99675)
+++ trunk/Tools/qmake/mkspecs/features/webcore.prf	2011-11-09 10:37:31 UTC (rev 99676)
@@ -289,17 +289,5 @@
 
 config_step {
     pathToWebCoreOutput = $$buildDirForSource(Source/WebCore)/$$WEBCORE_DESTDIR
-
-    win32-msvc*|wince*|win32-icc {
-        LIBS = -l$$WEBCORE_TARGET $$LIBS
-        LIBS = -L$$pathToWebCoreOutput $$LIBS
-        POST_TARGETDEPS += $${pathToWebCoreOutput}$${QMAKE_DIR_SEP}$${WEBCORE_TARGET}.lib
-    } else {
-        QMAKE_LIBDIR = $$pathToWebCoreOutput $$QMAKE_LIBDIR
-        LIBS = -l$$WEBCORE_TARGET $$LIBS
-        POST_TARGETDEPS += $${pathToWebCoreOutput}$${QMAKE_DIR_SEP}lib$${WEBCORE_TARGET}.a
-    }
-
-    CONFIG -= explicitlib
-    CONFIG -= staticlib
+    linkStaticLibrary($$pathToWebCoreOutput, $$WEBCORE_TARGET)
 }

Modified: trunk/Tools/qmake/mkspecs/features/webkit2.prf (99675 => 99676)


--- trunk/Tools/qmake/mkspecs/features/webkit2.prf	2011-11-09 10:18:04 UTC (rev 99675)
+++ trunk/Tools/qmake/mkspecs/features/webkit2.prf	2011-11-09 10:37:31 UTC (rev 99676)
@@ -66,18 +66,5 @@
 
 config_step {
     pathToWebKit2Output = $$buildDirForSource(Source/WebKit2)/$$WEBKIT2_DESTDIR
-
-    win32-msvc*|wince*|win32-icc {
-        LIBS = -l$$WEBKIT2_TARGET $$LIBS
-        LIBS = -L$$pathToWebKit2Output $$LIBS
-        POST_TARGETDEPS += $${pathToWebKit2Output}$${QMAKE_DIR_SEP}$${WEBKIT2_TARGET}.lib
-    } else {
-        QMAKE_LIBDIR = $$pathToWebKit2Output $$QMAKE_LIBDIR
-        LIBS = -l$$WEBKIT2_TARGET $$LIBS
-        POST_TARGETDEPS += $${pathToWebKit2Output}$${QMAKE_DIR_SEP}lib$${WEBKIT2_TARGET}.a
-    }
-
-    # The following line is to prevent qmake from adding webkit2 to libQtWebKit's prl dependencies.
-    CONFIG -= explicitlib
-    CONFIG -= staticlib
+    linkStaticLibrary($$pathToWebKit2Output, $$WEBKIT2_TARGET)
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to