2010-06-09 Leandro Pereira <leandro@profusion.mobi>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jun 2010 20:31:37 +0000 (20:31 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jun 2010 20:31:37 +0000 (20:31 +0000)
        Reviewed by Adam Treat.

        [EFL] Allow building core libraries as shared objects to speed up
        linking time on machines with small amounts of memory.
        http://webkit.org/b/39899

        * CMakeLists.txt: Add SHARED_CORE option.
        * cmake/FindGlib.cmake: Add GObject to the list of GLib libraries to
        search.
        * cmake/OptionsEfl.cmake: Remove default library type definitions.
        * cmake/WebKitHelpers.cmake: -fvisibility=hidden did not behave well
        when SHARED_CORE is used.
2010-06-09  Leandro Pereira  <leandro@profusion.mobi>

        Reviewed by Adam Treat.

        [EFL] Allow building core libraries as shared objects to speed up
        linking time on machines with small amounts of memory.
        http://webkit.org/b/39899

        * CMakeLists.txt: If building with shared core, install the lib.
        * jsc/CMakeListsEfl.txt: Needs Glib and Ecore to link dynamically.
        * wtf/CMakeLists.txt: If building with shared core, install the lib.
2010-06-09  Leandro Pereira  <leandro@profusion.mobi>

        Reviewed by Adam Treat.

        [EFL] Allow building core libraries as shared objects to speed up
        linking time on machines with small amounts of memory.
        http://webkit.org/b/39899

        * CMakeLists.txt: If building with shared core, install the lib.
        Remove npapi.cpp (causes conflicts when linking dynamically).
        * CMakeListsEfl.txt: EFL libraries are needed to link dynamically.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60909 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
CMakeLists.txt
ChangeLog
JavaScriptCore/CMakeLists.txt
JavaScriptCore/ChangeLog
JavaScriptCore/jsc/CMakeListsEfl.txt
JavaScriptCore/wtf/CMakeLists.txt
WebCore/CMakeLists.txt
WebCore/CMakeListsEfl.txt
WebCore/ChangeLog
cmake/FindGlib.cmake
cmake/OptionsEfl.cmake
cmake/WebKitHelpers.cmake

index 3748c26..ca2e1c4 100644 (file)
@@ -65,11 +65,20 @@ SET(WebCore_LIBRARY_NAME WebCore)
 SET(WebKit_LIBRARY_NAME WebKit)
 
 # -----------------------------------------------------------------------------
-# Default library types (can be overrriden in Options${PORT}.cmake file)
+# Default library types
 # -----------------------------------------------------------------------------
-SET(WTF_LIBRARY_TYPE STATIC)
-SET(JavaScriptCore_LIBRARY_TYPE STATIC)
-SET(WebCore_LIBRARY_TYPE STATIC)
+OPTION(SHARED_CORE "build WTF, JavaScriptCore and WebCore as shared libraries")
+
+IF (SHARED_CORE)
+    SET(WTF_LIBRARY_TYPE SHARED)
+    SET(JavaScriptCore_LIBRARY_TYPE SHARED)
+    SET(WebCore_LIBRARY_TYPE SHARED)
+ELSE ()
+    SET(WTF_LIBRARY_TYPE STATIC)
+    SET(JavaScriptCore_LIBRARY_TYPE STATIC)
+    SET(WebCore_LIBRARY_TYPE STATIC)
+ENDIF ()
+
 SET(WebKit_LIBRARY_TYPE SHARED)
 
 # -----------------------------------------------------------------------------
index 1dc092c..8359e3a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-06-09  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Adam Treat.
+
+        [EFL] Allow building core libraries as shared objects to speed up
+        linking time on machines with small amounts of memory.
+        http://webkit.org/b/39899
+
+        * CMakeLists.txt: Add SHARED_CORE option.
+        * cmake/FindGlib.cmake: Add GObject to the list of GLib libraries to
+        search.
+        * cmake/OptionsEfl.cmake: Remove default library type definitions.
+        * cmake/WebKitHelpers.cmake: -fvisibility=hidden did not behave well
+        when SHARED_CORE is used.
+
 2010-06-08  Xan Lopez  <xlopez@igalia.com>
 
         Reviewed by Gustavo Noronha.
index da7e119..d4a85d0 100644 (file)
@@ -274,5 +274,6 @@ ADD_LIBRARY(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_TYPE} ${Java
 TARGET_LINK_LIBRARIES(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARIES})
 ADD_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} LINK_FLAGS ${JavaScriptCore_LINK_FLAGS})
 
-INSTALL(TARGETS ${JavaScriptCore_LIBRARY_NAME} DESTINATION lib)
-
+IF (SHARED_CORE)
+    INSTALL(TARGETS ${JavaScriptCore_LIBRARY_NAME} DESTINATION lib)
+ENDIF ()
index 2e4afd7..4b4606d 100644 (file)
@@ -1,3 +1,15 @@
+2010-06-09  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Adam Treat.
+
+        [EFL] Allow building core libraries as shared objects to speed up
+        linking time on machines with small amounts of memory.
+        http://webkit.org/b/39899
+
+        * CMakeLists.txt: If building with shared core, install the lib.
+        * jsc/CMakeListsEfl.txt: Needs Glib and Ecore to link dynamically.
+        * wtf/CMakeLists.txt: If building with shared core, install the lib.
+
 2010-06-09  Gabor Loki  <loki@webkit.org>
 
         Reviewed by David Levin.
index ab1a013..58d44f4 100644 (file)
@@ -1,3 +1,8 @@
+LIST(APPEND JSC_LIBRARIES
+    ${Glib_LIBRARIES}
+    ${ECORE_LIBRARIES}
+)
+
 LIST(APPEND JSC_LINK_FLAGS
     ${ECORE_LDFLAGS}
 )
index f4d90ce..db69117 100644 (file)
@@ -39,3 +39,7 @@ ADD_LIBRARY(${WTF_LIBRARY_NAME} ${WTF_LIBRARY_TYPE} ${WTF_SOURCES})
 TARGET_LINK_LIBRARIES(${WTF_LIBRARY_NAME} ${WTF_LIBRARIES})
 
 ADD_TARGET_PROPERTIES(${WTF_LIBRARY_NAME} LINK_FLAGS ${WTF_LINK_FLAGS})
+
+IF (SHARED_CORE)
+    INSTALL(TARGETS ${WTF_LIBRARY_NAME} DESTINATION lib)
+ENDIF ()
index a1243dc..db4f8e7 100644 (file)
@@ -1260,7 +1260,6 @@ SET(WebCore_SOURCES
     plugins/PluginDataNone.cpp
     plugins/PluginMainThreadScheduler.cpp
     plugins/PluginViewNone.cpp
-    plugins/npapi.cpp
 
     rendering/AutoTableLayout.cpp
     rendering/BidiRun.cpp
@@ -1732,11 +1731,16 @@ SOURCE_GROUP(wml "wml/")
 SOURCE_GROUP(workers "workers/")
 SOURCE_GROUP(xml "xml/")
 
+SET(WebCore_LINK_FLAGS "")
 INCLUDE_IF_EXISTS(${WEBCORE_DIR}/CMakeLists${PORT}.txt)
 
 ADD_DEFINITIONS(-DBUILDING_WebCore)
 INCLUDE_DIRECTORIES(${WebCore_INCLUDE_DIRECTORIES})
 ADD_LIBRARY(${WebCore_LIBRARY_NAME} ${WebCore_LIBRARY_TYPE} ${WebCore_SOURCES})
 TARGET_LINK_LIBRARIES(${WebCore_LIBRARY_NAME} ${WebCore_LIBRARIES})
+ADD_TARGET_PROPERTIES(${WebCore_LIBRARY_NAME} LINK_FLAGS ${WebCore_LINK_FLAGS})
 
-INSTALL(TARGETS ${WebCore_LIBRARY_NAME} DESTINATION lib)
+
+IF (SHARED_CORE)
+    INSTALL(TARGETS ${WebCore_LIBRARY_NAME} DESTINATION lib)
+ENDIF ()
index b4667af..39e5386 100644 (file)
@@ -1,3 +1,8 @@
+LIST(APPEND WebCore_LINK_FLAGS
+    ${ECORE_X_LDFLAGS}
+    ${EFLDEPS_LDFLAGS}
+)
+
 LIST(APPEND WebCore_INCLUDE_DIRECTORIES
   "${JAVASCRIPTCORE_DIR}/wtf/gobject"
   "${JAVASCRIPTCORE_DIR}/wtf/text"
index 7ddd75b..be7a28d 100644 (file)
@@ -1,3 +1,15 @@
+2010-06-09  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Adam Treat.
+
+        [EFL] Allow building core libraries as shared objects to speed up
+        linking time on machines with small amounts of memory.
+        http://webkit.org/b/39899
+
+        * CMakeLists.txt: If building with shared core, install the lib.
+        Remove npapi.cpp (causes conflicts when linking dynamically).
+        * CMakeListsEfl.txt: EFL libraries are needed to link dynamically.
+
 2010-06-09  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Adele Peterson.
index d3547d5..d4b73af 100644 (file)
@@ -29,11 +29,15 @@ find_library(Glib_LIBRARY
   NAMES glib-2.0
   PATHS ${Glib_PKGCONF_LIBRARY_DIRS}
 )
+find_library(Gobject_LIBRARY
+  NAMES gobject-2.0
+  PATHS ${Glib_PKGCONF_LIBRARY_DIRS}
+)
 
 # Set the include dir variables and the libraries and let libfind_process do the rest.
 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
 set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR)
-set(Glib_PROCESS_LIBS Glib_LIBRARY)
+set(Glib_PROCESS_LIBS Glib_LIBRARY Gobject_LIBRARY)
 libfind_process(Glib)
 
 
index 87b3d72..af181c8 100644 (file)
@@ -50,11 +50,6 @@ SET(JavaScriptCore_LIBRARY_NAME javascriptcore)
 SET(WebCore_LIBRARY_NAME webcore)
 SET(WebKit_LIBRARY_NAME ewebkit)
 
-SET(WTF_LIBRARY_TYPE STATIC)
-SET(JavaScriptCore_LIBRARY_TYPE STATIC)
-SET(WebCore_LIBRARY_TYPE STATIC)
-SET(WebKit_LIBRARY_TYPE SHARED)
-
 WEBKIT_FEATURE(ENABLE_AS_IMAGE "Enable SVG as image" DEFAULT ON SVG)
 WEBKIT_FEATURE(ENABLE_BLOB_SLICE "Enable blob slice" DEFAULT OFF)
 WEBKIT_FEATURE(ENABLE_CHANNEL_MESSAGING "Enable channel messaging" DEFAULT ON)
index 4d86b8e..ae48e14 100644 (file)
@@ -6,8 +6,13 @@ MACRO(WEBKIT_SET_EXTRA_COMPILER_FLAGS _target)
     IF (${OLD_COMPILE_FLAGS} STREQUAL "OLD_COMPILE_FLAGS-NOTFOUND")
         SET(OLD_COMPILE_FLAGS "")
     ENDIF ()
-    SET_TARGET_PROPERTIES (${_target} PROPERTIES
-       COMPILE_FLAGS "-fno-exceptions -fstrict-aliasing -fvisibility=hidden ${OLD_COMPILE_FLAGS}")
+    IF (SHARED_CORE)
+        SET_TARGET_PROPERTIES (${_target} PROPERTIES
+            COMPILE_FLAGS "-fno-exceptions -fstrict-aliasing ${OLD_COMPILE_FLAGS}")
+    ELSE ()
+        SET_TARGET_PROPERTIES (${_target} PROPERTIES
+            COMPILE_FLAGS "-fno-exceptions -fstrict-aliasing -fvisibility=hidden ${OLD_COMPILE_FLAGS}")
+    ENDIF ()
     UNSET(OLD_COMPILE_FLAGS)
   ENDIF ()
 ENDMACRO()