.:
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Nov 2019 22:57:46 +0000 (22:57 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Nov 2019 22:57:46 +0000 (22:57 +0000)
[Win][CMake] Build WebCore as an OBJECT library for WinCairo port
https://bugs.webkit.org/show_bug.cgi?id=203663

Reviewed by Ross Kirsling.

WebCore is using __declspec(dllexport) to export symbols, but it
is built as a static library rather than a DLL. If any symbols in
an object file aren't referenced from WebKit.dll, they won't be
included in WebKit.dll.

This issue can be solved either by using OBJECT library for
WebCore or using /WHOLEARCHIVE:WebCore.lib for WebKit.

This change takes OBJECT library approach becuase it doesn't
generate unnecessary static libs (WebCore.lib) and it's already
used for non-unified source builds for the library size issue (Bug
196866 Comment 4).

However, AppleWin can't use it because the Apple internal builds
need to generate the static libs and OBJECT library doesn't work
well with makesafeseh.obj.

* Source/cmake/OptionsWin.cmake: Removed code overriding library types.
* Source/cmake/OptionsWinCairo.cmake: Use OBJECT library types for WebCore and WebCoreTestSupport.

Source/WebCore:
[Win][CMake] Build WebCore as an OBJECT library unless Apple internal builds
https://bugs.webkit.org/show_bug.cgi?id=203663

Reviewed by Ross Kirsling.

No behavioral changes.

* CMakeLists.txt: Changed WebCoreTestSupport not to link with
WebCore for Windows. Because WebKit.dll exports WebCore symbols,
they will be duplicated with WebCore.

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

ChangeLog
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/cmake/OptionsWin.cmake
Source/cmake/OptionsWinCairo.cmake

index 00ce71b..cbc3ff8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2019-11-05  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [Win][CMake] Build WebCore as an OBJECT library for WinCairo port
+        https://bugs.webkit.org/show_bug.cgi?id=203663
+
+        Reviewed by Ross Kirsling.
+
+        WebCore is using __declspec(dllexport) to export symbols, but it
+        is built as a static library rather than a DLL. If any symbols in
+        an object file aren't referenced from WebKit.dll, they won't be
+        included in WebKit.dll.
+
+        This issue can be solved either by using OBJECT library for
+        WebCore or using /WHOLEARCHIVE:WebCore.lib for WebKit.
+
+        This change takes OBJECT library approach becuase it doesn't
+        generate unnecessary static libs (WebCore.lib) and it's already
+        used for non-unified source builds for the library size issue (Bug
+        196866 Comment 4).
+
+        However, AppleWin can't use it because the Apple internal builds
+        need to generate the static libs and OBJECT library doesn't work
+        well with makesafeseh.obj.
+
+        * Source/cmake/OptionsWin.cmake: Removed code overriding library types.
+        * Source/cmake/OptionsWinCairo.cmake: Use OBJECT library types for WebCore and WebCoreTestSupport.
+
 2019-11-02  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Add diagnostic logging for frontend feature usage
index 61a9b0a..f336845 100644 (file)
@@ -1230,9 +1230,11 @@ set(WebCore_LIBRARIES
 )
 
 set(WebCoreTestSupport_LIBRARIES
-    WebCore
     WebKit::JavaScriptCore
 )
+if (NOT WTF_OS_WINDOWS)
+    list(APPEND WebCoreTestSupport_LIBRARIES WebCore)
+endif ()
 
 if (ENABLE_LEGACY_ENCRYPTED_MEDIA)
     list(APPEND WebCore_SOURCES
index 0590f3a..277d136 100644 (file)
@@ -1,3 +1,16 @@
+2019-11-05  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [Win][CMake] Build WebCore as an OBJECT library unless Apple internal builds
+        https://bugs.webkit.org/show_bug.cgi?id=203663
+
+        Reviewed by Ross Kirsling.
+
+        No behavioral changes.
+
+        * CMakeLists.txt: Changed WebCoreTestSupport not to link with
+        WebCore for Windows. Because WebKit.dll exports WebCore symbols,
+        they will be duplicated with WebCore.
+
 2019-11-05  Ryosuke Niwa  <rniwa@webkit.org>
 
         REGRESSION (r251930): Flaky WK1 crash in printing/pseudo-class-outside-page.html
index cbdc301..1019fce 100644 (file)
@@ -161,15 +161,6 @@ set(WTF_LIBRARY_TYPE SHARED)
 set(PAL_LIBRARY_TYPE STATIC)
 set(WebKitLegacy_LIBRARY_TYPE SHARED)
 
-if (NOT ENABLE_UNIFIED_BUILDS)
-    if (WebCore_LIBRARY_TYPE MATCHES STATIC)
-        set(WebCore_LIBRARY_TYPE OBJECT)
-    endif ()
-    if (WebCoreTestSupport_LIBRARY_TYPE MATCHES STATIC)
-        set(WebCoreTestSupport_LIBRARY_TYPE OBJECT)
-    endif ()
-endif ()
-
 # If <winsock2.h> is not included before <windows.h> redefinition errors occur
 # unless _WINSOCKAPI_ is defined before <windows.h> is included
 add_definitions(-D_WINSOCKAPI_=)
index 5d96bd2..54bb287 100644 (file)
@@ -64,3 +64,7 @@ set(WebKit_DERIVED_SOURCES_DIR ${CMAKE_BINARY_DIR}/WebKit/DerivedSources)
 # Override scripts directories
 set(WTF_SCRIPTS_DIR ${CMAKE_BINARY_DIR}/WTF/Scripts)
 set(JavaScriptCore_SCRIPTS_DIR ${CMAKE_BINARY_DIR}/JavaScriptCore/Scripts)
+
+# Override library types
+set(WebCore_LIBRARY_TYPE OBJECT)
+set(WebCoreTestSupport_LIBRARY_TYPE OBJECT)