[Win] Fix AppleWin build
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jan 2020 15:56:57 +0000 (15:56 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jan 2020 15:56:57 +0000 (15:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=206299

Reviewed by Brent Fulgham.

.:

This patch has been created by don.olmstead@sony.com and pvollan@apple.com. Add target files for WTF and
JavaScriptCore. Also, to make sure headers are copied to the forwarding headers directory, add the CMake
keywork ALL when adding custom target for copying files.

* Source/cmake/TargetJavaScriptCore.cmake: Added.
* Source/cmake/TargetWTF.cmake: Added.
* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

Include required target. Build internal builds with VS2019.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.proj:

Source/WebCore:

Include required targets. Build internal builds with VS2019.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.proj:

Source/WebKitLegacy:

Include required targets. Build internal builds with VS2019.

* CMakeLists.txt:
* WebKitLegacy.vcxproj/WebKitLegacy.proj:

Source/WTF:

Build internal builds with VS2019.

* WTF.vcxproj/WTF.proj:

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

15 files changed:
ChangeLog
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.proj
Source/WTF/ChangeLog
Source/WTF/WTF.vcxproj/WTF.proj
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcxproj/WebCore.proj
Source/WebKitLegacy/CMakeLists.txt
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/WebKitLegacy.vcxproj/WebKitLegacy.proj
Source/cmake/WebKitMacros.cmake
Source/cmake/target/TargetJavaScriptCore.cmake [new file with mode: 0644]
Source/cmake/target/TargetWTF.cmake [new file with mode: 0644]

index 12904e5..ef141e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2020-01-16  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Fix AppleWin build
+        https://bugs.webkit.org/show_bug.cgi?id=206299
+
+        Reviewed by Brent Fulgham.
+
+        This patch has been created by don.olmstead@sony.com and pvollan@apple.com. Add target files for WTF and
+        JavaScriptCore. Also, to make sure headers are copied to the forwarding headers directory, add the CMake
+        keywork ALL when adding custom target for copying files.
+
+        * Source/cmake/TargetJavaScriptCore.cmake: Added.
+        * Source/cmake/TargetWTF.cmake: Added.
+        * Source/cmake/WebKitMacros.cmake:
+
 2020-01-10  Dean Jackson  <dino@apple.com>
 
         [WebGL] Clarify USE_OPENGL_ES_3
index 190a66d..b917bc5 100644 (file)
@@ -1,5 +1,6 @@
 cmake_minimum_required(VERSION 3.10)
 include(WebKitCommon)
+include(target/TargetWTF)
 set_property(DIRECTORY . PROPERTY FOLDER "JavaScriptCore")
 
 list(APPEND JavaScriptCore_UNIFIED_SOURCE_LIST_FILES
index 7dd4af7..acd00c8 100644 (file)
@@ -1,3 +1,15 @@
+2020-01-16  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Fix AppleWin build
+        https://bugs.webkit.org/show_bug.cgi?id=206299
+
+        Reviewed by Brent Fulgham.
+
+        Include required target. Build internal builds with VS2019.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.proj:
+
 2020-01-16  Caio Lima  <ticaiolima@gmail.com>
 
         [JSC] 32-bit platforms should use a PC base register
index 0f89bc8..4107596 100644 (file)
@@ -54,9 +54,9 @@
   <Target Name="Build" AfterTargets="PreBuild">\r
     <Message Text="Building $(CONFIGURATION) Solution" />\r
     <Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />\r
-       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
+       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -A Win32 -G &quot;Visual Studio 16 2019&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
        <Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
-       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
+       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -A x64 -G &quot;Visual Studio 16 2019&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
        <Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
   </Target>\r
 \r
index bb5077b..73f49aa 100644 (file)
@@ -1,3 +1,14 @@
+2020-01-16  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Fix AppleWin build
+        https://bugs.webkit.org/show_bug.cgi?id=206299
+
+        Reviewed by Brent Fulgham.
+
+        Build internal builds with VS2019.
+
+        * WTF.vcxproj/WTF.proj:
+
 2020-01-15  Sam Weinig  <weinig@apple.com>
 
         Platform.h is out of control Part 5: Split HAVE_* macro definitions out of Platform.h and into a new PlatformHave.h
index 5291658..4c796cd 100644 (file)
@@ -46,9 +46,9 @@
   <Target Name="Build" AfterTargets="PreBuild">\r
     <Message Text="Building $(CONFIGURATION) Solution" />\r
     <Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />\r
-       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
+       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -A Win32 -G &quot;Visual Studio 16 2019&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
        <Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
-       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
+       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -A x64 -G &quot;Visual Studio 16 2019&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
        <Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
   </Target>\r
 \r
index b91ff15..bdf5031 100644 (file)
@@ -1,6 +1,8 @@
 cmake_minimum_required(VERSION 3.10)
 
 include(WebKitCommon)
+include(target/TargetWTF)
+include(target/TargetJavaScriptCore)
 include(WebCoreMacros.cmake)
 include(Headers.cmake)
 
index 3ae3ae6..349a4e5 100644 (file)
@@ -1,3 +1,15 @@
+2020-01-16  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Fix AppleWin build
+        https://bugs.webkit.org/show_bug.cgi?id=206299
+
+        Reviewed by Brent Fulgham.
+
+        Include required targets. Build internal builds with VS2019.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.proj:
+
 2020-01-16  Tomoki Imai  <Tomoki.Imai@sony.com>
 
         Do not detect the stopped animations in Nicosia::Animation to avoid flashback
index 0e0791c..34a5bd8 100644 (file)
@@ -54,9 +54,9 @@
   <Target Name="Build" AfterTargets="PreBuild">\r
     <Message Text="Building $(CONFIGURATION) Solution" />\r
     <Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />\r
-       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
+       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -A Win32 -G &quot;Visual Studio 16 2019&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
        <Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
-       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
+       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -A x64 -G &quot;Visual Studio 16 2019&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
        <Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
   </Target>\r
 \r
index 02665bd..2575962 100644 (file)
@@ -1,5 +1,7 @@
 cmake_minimum_required(VERSION 3.10)
 include(WebKitCommon)
+include(target/TargetWTF)
+include(target/TargetJavaScriptCore)
 set_property(DIRECTORY . PROPERTY FOLDER "WebKitLegacy")
 
 set(WebKitLegacy_SOURCES
index 50bac67..d8919ae 100644 (file)
@@ -1,3 +1,15 @@
+2020-01-16  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Fix AppleWin build
+        https://bugs.webkit.org/show_bug.cgi?id=206299
+
+        Reviewed by Brent Fulgham.
+
+        Include required targets. Build internal builds with VS2019.
+
+        * CMakeLists.txt:
+        * WebKitLegacy.vcxproj/WebKitLegacy.proj:
+
 2020-01-07  Sihui Liu  <sihui_liu@apple.com>
 
         REGRESSION (r248734): different threads write m_storageMap of StorageAreaImpl at the same time
index 544ccab..85a3bc6 100644 (file)
@@ -54,9 +54,9 @@
   <Target Name="Build" AfterTargets="PreBuild">\r
     <Message Text="Building $(CONFIGURATION) Solution" />\r
     <Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />\r
-       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
+       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -A Win32 -G &quot;Visual Studio 16 2019&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
        <Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>\r
-       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
+       <Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -A x64 -G &quot;Visual Studio 16 2019&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
        <Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>\r
   </Target>\r
 \r
index 9a09cb7..56ded9d 100644 (file)
@@ -370,7 +370,7 @@ function(WEBKIT_COPY_FILES target_name)
         )
         list(APPEND dst_files ${dst_file})
     endforeach ()
-    add_custom_target(${target_name} DEPENDS ${dst_files})
+    add_custom_target(${target_name} ALL DEPENDS ${dst_files})
 endfunction()
 
 # Helper macros for debugging CMake problems.
diff --git a/Source/cmake/target/TargetJavaScriptCore.cmake b/Source/cmake/target/TargetJavaScriptCore.cmake
new file mode 100644 (file)
index 0000000..c295aac
--- /dev/null
@@ -0,0 +1,19 @@
+if (NOT TARGET WebKit::JavaScriptCore)
+    if (NOT INTERNAL_BUILD)
+        message(FATAL_ERROR "WebKit::JavaScriptCore target not found")
+    endif ()
+
+    # This should be moved to an if block if the Apple Mac/iOS build moves completely to CMake
+    # Just assuming Windows for the moment
+    add_library(WebKit::JavaScriptCore SHARED IMPORTED)
+    set_target_properties(WebKit::JavaScriptCore PROPERTIES
+        IMPORTED_LOCATION ${WEBKIT_LIBRARIES_RUNTIME_DIR}/JavaScriptCore${DEBUG_SUFFIX}.dll
+        IMPORTED_IMPLIB ${WEBKIT_LIBRARIES_LINK_DIR}/JavaScriptCore${DEBUG_SUFFIX}.lib
+        # Should add Apple::CoreFoundation here when https://bugs.webkit.org/show_bug.cgi?id=205085 lands
+        INTERFACE_LINK_LIBRARIES "WebKit::WTF;ICU::data;ICU::i18n;ICU::uc"
+    )
+    target_include_directories(WebKit::JavaScriptCore INTERFACE
+        ${JavaScriptCore_FRAMEWORK_HEADERS_DIR}
+        ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
+    )
+endif ()
diff --git a/Source/cmake/target/TargetWTF.cmake b/Source/cmake/target/TargetWTF.cmake
new file mode 100644 (file)
index 0000000..b8a0110
--- /dev/null
@@ -0,0 +1,18 @@
+if (NOT TARGET WebKit::WTF)
+    if (NOT INTERNAL_BUILD)
+        message(FATAL_ERROR "WebKit::WTF target not found")
+    endif ()
+
+    # This should be moved to an if block if the Apple Mac/iOS build moves completely to CMake
+    # Just assuming Windows for the moment
+    add_library(WebKit::WTF SHARED IMPORTED)
+    set_target_properties(WebKit::WTF PROPERTIES
+        IMPORTED_LOCATION ${WEBKIT_LIBRARIES_RUNTIME_DIR}/WTF${DEBUG_SUFFIX}.dll
+        IMPORTED_IMPLIB ${WEBKIT_LIBRARIES_LINK_DIR}/WTF${DEBUG_SUFFIX}.lib
+        # Should add Apple::CoreFoundation here when https://bugs.webkit.org/show_bug.cgi?id=205085 lands
+        INTERFACE_LINK_LIBRARIES "ICU::data;ICU::i18n;ICU::uc"
+    )
+    target_include_directories(WebKit::WTF INTERFACE
+        ${WTF_FRAMEWORK_HEADERS_DIR}
+    )
+endif ()