Isolate Source directories in CMake build
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Aug 2015 21:36:49 +0000 (21:36 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Aug 2015 21:36:49 +0000 (21:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148389

Reviewed by Brent Fulgham.

.:

* CMakeLists.txt:
* Source/cmake/WebKitCommon.cmake:
Move package finding to WebKitCommon.

Source/JavaScriptCore:

* PlatformWin.cmake:
Include ../include/private to find WTF headers in internal build.
Don't use a script to generate forwarding headers.
* shell/PlatformWin.cmake:
Copy inspector scripts to the forwarding headers directory to be used by WebCore.

Source/WebCore:

* CMakeLists.txt:
Use the forwarding header copy of the inspector scripts to avoid requiring JavaScriptCore directory to exist.
* PlatformAppleWin.cmake:
Add AVFoundation sources to build.
* PlatformEFL.cmake:
Moved WebKitVersion.h generating from CMakeLists.txt because it is now only used in WebCore by EFL.
* PlatformWin.cmake:
Include ../include/private to find forwarding headers in internal build.

Source/WebKit:

* PlatformWin.cmake:
Moved WebKitVersion.h generation from WebCore because the scripts required for it are in WebKit.

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

13 files changed:
CMakeLists.txt
ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/PlatformWin.cmake
Source/JavaScriptCore/shell/PlatformWin.cmake
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformAppleWin.cmake
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformWin.cmake
Source/WebKit/ChangeLog
Source/WebKit/PlatformWin.cmake
Source/cmake/WebKitCommon.cmake

index e1560db..91b98d1 100644 (file)
@@ -30,30 +30,6 @@ endif ()
 string(TOLOWER ${PORT} WEBKIT_PORT_DIR)
 
 # -----------------------------------------------------------------------------
-# Find common packages (used by all ports)
-# -----------------------------------------------------------------------------
-find_package(BISON 2.3 REQUIRED)
-if (!APPLE)
-    find_package(FLEX 2.5.34 REQUIRED)
-endif ()
-
-# TODO Enforce version requirement for gperf
-find_package(Gperf 3.0.1 REQUIRED)
-
-# TODO Enforce version requirement for perl
-find_package(Perl 5.10.0 REQUIRED)
-
-find_package(PythonInterp 2.7.0 REQUIRED)
-
-# We cannot check for RUBY_FOUND because it is set only when the full package is installed and
-# the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
-# for finding only the Ruby interpreter.
-find_package(Ruby 1.8.7)
-if (NOT RUBY_EXECUTABLE OR RUBY_VERSION VERSION_LESS 1.8.7)
-    message(FATAL_ERROR "Ruby 1.8.7 or higher is required.")
-endif ()
-
-# -----------------------------------------------------------------------------
 # Determine the target processor
 # -----------------------------------------------------------------------------
 # Use MSVC_CXX_ARCHITECTURE_ID instead of CMAKE_SYSTEM_PROCESSOR when defined,
index 521b8c7..1756ce6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-08-27  Alex Christensen  <achristensen@webkit.org>
+
+        Isolate Source directories in CMake build
+        https://bugs.webkit.org/show_bug.cgi?id=148389
+
+        Reviewed by Brent Fulgham.
+
+        * CMakeLists.txt:
+        * Source/cmake/WebKitCommon.cmake:
+        Move package finding to WebKitCommon.
+
 2015-08-26  Per Arne Vollan  <peavo@outlook.com>
 
         [Win] Build does not generate debug info.
index 3a81053..c9fa3b9 100644 (file)
@@ -1,5 +1,18 @@
 2015-08-27  Alex Christensen  <achristensen@webkit.org>
 
+        Isolate Source directories in CMake build
+        https://bugs.webkit.org/show_bug.cgi?id=148389
+
+        Reviewed by Brent Fulgham.
+
+        * PlatformWin.cmake:
+        Include ../include/private to find WTF headers in internal build.
+        Don't use a script to generate forwarding headers.
+        * shell/PlatformWin.cmake:
+        Copy inspector scripts to the forwarding headers directory to be used by WebCore.
+
+2015-08-27  Alex Christensen  <achristensen@webkit.org>
+
         [Win CMake] Fix incremental build after r188673
         https://bugs.webkit.org/show_bug.cgi?id=148539
 
index 22f0f08..d41c2b9 100644 (file)
@@ -3,6 +3,10 @@ list(APPEND JavaScriptCore_SOURCES
     API/JSStringRefCF.cpp
 )
 
+list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
+    ${CMAKE_BINARY_DIR}/../include/private
+)
+
 if (WTF_PLATFORM_WIN_CAIRO)
     list(APPEND JavaScriptCore_LIBRARIES
         CFLite
@@ -14,17 +18,6 @@ else ()
     )
 endif ()
 
-if (MSVC AND "${JavaScriptCore_LIBRARY_TYPE}" MATCHES "SHARED")
-    get_property(WTF_LIBRARY_LOCATION TARGET WTF PROPERTY LOCATION)
-
-    add_custom_command(
-        OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp
-        DEPENDS WTF
-        COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/Scripts/generate-win32-export-forwards ${WTF_LIBRARY_LOCATION} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp
-        VERBATIM)
-    list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp)
-endif ()
-
 list(REMOVE_ITEM JavaScriptCore_SOURCES
     inspector/JSGlobalObjectInspectorController.cpp
 )
@@ -39,6 +32,7 @@ file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore)
 set(JavaScriptCore_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore/postBuild.cmd")
 file(WRITE "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
 file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
+file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f /s \"${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector/scripts/*.*\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
 foreach (_directory ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES})
     file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${JAVASCRIPTCORE_DIR}/${_directory}/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
 endforeach ()
index 37ae18a..216efe9 100644 (file)
@@ -1,5 +1,10 @@
 include_directories(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
 add_library(jscdll SHARED ${JSC_SOURCES})
+
+list(APPEND JSC_LIBRARIES
+    Winmm
+)
+
 target_link_libraries(jscdll ${JSC_LIBRARIES})
 set_target_properties(jscdll PROPERTIES FOLDER "JavaScriptCore")
 set_target_properties(jscdll PROPERTIES OUTPUT_NAME "jsc${DEBUG_SUFFIX}")
@@ -8,7 +13,7 @@ if (${WTF_PLATFORM_WIN_CAIRO})
     add_definitions(-DWIN_CAIRO)
 endif ()
 
-set(JSC_SOURCES ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp)
+set(JSC_SOURCES ${JAVASCRIPTCORE_DIR}/JavaScriptCore.vcxproj/jsc/DLLLauncherMain.cpp)
 set(JSC_LIBRARIES shlwapi)
 add_definitions(-DUSE_CONSOLE_ENTRY_POINT)
 
index 589a13b..46070e0 100644 (file)
@@ -814,7 +814,15 @@ set(WebCore_IDL_FILES
     ${WebCore_SVG_IDL_FILES}
 )
 
-set(WebCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
+if (WIN32)
+    if (INTERNAL_BUILD)
+        set(WebCore_INSPECTOR_SCRIPTS_DIR "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore")
+    else ()
+        set(WebCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
+    endif ()
+else ()
+    set(WebCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
+endif ()
 
 set(WebCore_SOURCES
     Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp
@@ -3579,16 +3587,6 @@ list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/XMLNSNames.cpp)
 GENERATE_DOM_NAMES(XML ${WEBCORE_DIR}/xml/xmlattrs.in)
 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/XMLNames.cpp)
 
-if (NOT PORT STREQUAL "GTK")
-    add_custom_command(
-        OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitVersion.h
-        MAIN_DEPENDENCY ${WEBKIT_DIR}/scripts/generate-webkitversion.pl
-        DEPENDS ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig
-        COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/scripts/generate-webkitversion.pl --config ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig --outputDir ${DERIVED_SOURCES_WEBCORE_DIR}
-        VERBATIM)
-    list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitVersion.h)
-endif ()
-
 WEBKIT_WRAP_SOURCELIST(${WebCore_IDL_FILES} ${WebCore_SOURCES})
 WEBKIT_WRAP_SOURCELIST(${WebCoreTestSupport_IDL_FILES} ${WebCoreTestSupport_SOURCES})
 
index c5f0756..7e3f96f 100644 (file)
@@ -1,5 +1,21 @@
 2015-08-27  Alex Christensen  <achristensen@webkit.org>
 
+        Isolate Source directories in CMake build
+        https://bugs.webkit.org/show_bug.cgi?id=148389
+
+        Reviewed by Brent Fulgham.
+
+        * CMakeLists.txt:
+        Use the forwarding header copy of the inspector scripts to avoid requiring JavaScriptCore directory to exist.
+        * PlatformAppleWin.cmake:
+        Add AVFoundation sources to build.
+        * PlatformEFL.cmake:
+        Moved WebKitVersion.h generating from CMakeLists.txt because it is now only used in WebCore by EFL.
+        * PlatformWin.cmake:
+        Include ../include/private to find forwarding headers in internal build.
+
+2015-08-27  Alex Christensen  <achristensen@webkit.org>
+
         [Win CMake] Fix incremental build after r188673
         https://bugs.webkit.org/show_bug.cgi?id=148539
 
index 85aabb7..eeece21 100644 (file)
@@ -2,6 +2,8 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
     "${WEBKIT_LIBRARIES_DIR}/include"
     "${WEBKIT_LIBRARIES_DIR}/include/zlib"
     "${WEBCORE_DIR}/loader/archive/cf"
+    "${WEBCORE_DIR}/platform/graphics/avfoundation"
+    "${WEBCORE_DIR}/platform/graphics/avfoundation/cf"
     "${WEBCORE_DIR}/platform/graphics/ca"
     "${WEBCORE_DIR}/platform/graphics/ca/win"
     "${WEBCORE_DIR}/platform/graphics/cg"
@@ -20,6 +22,18 @@ list(APPEND WebCore_SOURCES
     platform/cf/CFURLExtras.cpp
     platform/cf/URLCF.cpp
 
+    platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp
+    platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
+    platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
+    platform/graphics/avfoundation/MediaTimeAVFoundation.cpp
+    platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp
+
+    platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp
+    platform/graphics/avfoundation/cf/ImbandTextTrackPrivateLegacyAVCF.cpp
+    platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp
+    platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
+    platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp
+
     platform/graphics/ca/GraphicsLayerCA.cpp
     platform/graphics/ca/LayerFlushScheduler.cpp
     platform/graphics/ca/LayerPool.cpp
index f469960..d16002d 100644 (file)
@@ -314,6 +314,14 @@ set(WebCore_USER_AGENT_SCRIPTS
     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsBase.js
 )
 
+add_custom_command(
+    OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitVersion.h
+    MAIN_DEPENDENCY ${WEBKIT_DIR}/scripts/generate-webkitversion.pl
+    DEPENDS ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig
+    COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/scripts/generate-webkitversion.pl --config ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig --outputDir ${DERIVED_SOURCES_WEBCORE_DIR}
+    VERBATIM)
+list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitVersion.h)
+
 set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/efl/RenderThemeEfl.cpp)
 
 list(APPEND WebCore_LIBRARIES
index 6456168..e336d9e 100644 (file)
@@ -1,6 +1,8 @@
 add_definitions(/bigobj)
 
 list(APPEND WebCore_INCLUDE_DIRECTORIES
+    "${CMAKE_BINARY_DIR}/../include/private"
+    "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore"
     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE"
     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/KHR"
     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore"
index 251e113..cb934e8 100644 (file)
@@ -1,3 +1,13 @@
+2015-08-27  Alex Christensen  <achristensen@webkit.org>
+
+        Isolate Source directories in CMake build
+        https://bugs.webkit.org/show_bug.cgi?id=148389
+
+        Reviewed by Brent Fulgham.
+
+        * PlatformWin.cmake:
+        Moved WebKitVersion.h generation from WebCore because the scripts required for it are in WebKit.
+
 2015-08-27  Timothy Horton  <timothy_horton@apple.com>
 
         Factor out Lookup invocation
index 36a7fb0..e06d358 100644 (file)
@@ -46,7 +46,18 @@ else ()
     )
 endif ()
 
+add_custom_command(
+    OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebKitVersion.h
+    MAIN_DEPENDENCY ${WEBKIT_DIR}/scripts/generate-webkitversion.pl
+    DEPENDS ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig
+    COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/scripts/generate-webkitversion.pl --config ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig --outputDir ${DERIVED_SOURCES_WEBKIT_DIR}
+    VERBATIM)
+list(APPEND WebKit_SOURCES ${DERIVED_SOURCES_WEBKIT_DIR}/WebKitVersion.h)
+
 list(APPEND WebKit_INCLUDE_DIRECTORIES
+    "${CMAKE_BINARY_DIR}/../include/private"
+    "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore"
+    "${CMAKE_BINARY_DIR}/../include/private/WebCore"
     Storage
     win
     win/plugins
@@ -61,6 +72,7 @@ list(APPEND WebKit_INCLUDE_DIRECTORIES
     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include"
     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/egl"
     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/khr"
+    "${DERIVED_SOURCES_DIR}/WebKit"
 )
 
 list(APPEND WebKit_INCLUDES
@@ -384,7 +396,7 @@ set(WEBKIT_IDL_DEPENDENCIES
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/autoversion.h
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-    COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/WebKitLibraries/win/tools/scripts/auto-version.pl ${DERIVED_SOURCES_WEBKIT_DIR}
+    COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_WEBKIT_DIR}
     VERBATIM)
 
 GENERATE_INTERFACE(win/Interfaces/WebKit.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
@@ -442,6 +454,8 @@ if (ENABLE_GRAPHICS_CONTEXT_3D)
     )
 endif ()
 
+set(WebKit_LIBRARY_TYPE SHARED)
+
 # We need the webkit libraries to come before the system default libraries to prevent symbol conflicts with uuid.lib.
 # To do this we add system default libs as webkit libs and zero out system default libs.
 string(REPLACE " " "\;" CXX_LIBS ${CMAKE_CXX_STANDARD_LIBRARIES})
index 032cae9..0f11cc9 100644 (file)
@@ -1,3 +1,27 @@
+# -----------------------------------------------------------------------------
+# Find common packages (used by all ports)
+# -----------------------------------------------------------------------------
+find_package(BISON 2.3 REQUIRED)
+if (!APPLE)
+    find_package(FLEX 2.5.34 REQUIRED)
+endif ()
+
+# TODO Enforce version requirement for gperf
+find_package(Gperf 3.0.1 REQUIRED)
+
+# TODO Enforce version requirement for perl
+find_package(Perl 5.10.0 REQUIRED)
+
+find_package(PythonInterp 2.7.0 REQUIRED)
+
+# We cannot check for RUBY_FOUND because it is set only when the full package is installed and
+# the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
+# for finding only the Ruby interpreter.
+find_package(Ruby 1.8.7)
+if (NOT RUBY_EXECUTABLE OR RUBY_VERSION VERSION_LESS 1.8.7)
+    message(FATAL_ERROR "Ruby 1.8.7 or higher is required.")
+endif ()
+
 include(WebKitMacros)
 include(WebKitFS)
 include(WebKitHelpers)