[Win] Improve CMake build performance
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Mar 2016 16:14:20 +0000 (16:14 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Mar 2016 16:14:20 +0000 (16:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155871
<rdar://problem/24747822>

Reviewed by Alex Christensen.

.:

Add a flag to the PROCESS_ALLINONE_FILE macro so that it does not remove
the files contained in the passed all-in-one file, since this breaks
dependency checking and generation of the derived sources from the IDL.
Instead, include the header files in the project so that all files get
generated.

* Source/cmake/WebKitMacros: Updated for 'DerivedSources.cpp' use case.

Source/WebCore:

Treat DerivedSources.cpp as an 'All-in-one' file. Pass a flag to the
PROCESS_ALLINONE_FILE macro so that it does not remove the contents of
the file, since this breaks dependency checking and generation of the
sources from the IDL files. Instead, include the header files in the
project so that all files get generated.

* CMakeLists.txt: Updated for 'DerivedSources.cpp'
* DerivedSources.cpp: Add some generated files that were missing.

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

ChangeLog
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/cmake/WebKitMacros.cmake

index 8e35535..276b4d9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2016-03-25  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Improve CMake build performance 
+        https://bugs.webkit.org/show_bug.cgi?id=155871
+        <rdar://problem/24747822>
+
+        Reviewed by Alex Christensen.
+
+        Add a flag to the PROCESS_ALLINONE_FILE macro so that it does not remove
+        the files contained in the passed all-in-one file, since this breaks
+        dependency checking and generation of the derived sources from the IDL.
+        Instead, include the header files in the project so that all files get
+        generated.        
+        
+        * Source/cmake/WebKitMacros: Updated for 'DerivedSources.cpp' use case.
+
 2016-03-25  Konstantin Tokarev  <annulen@yandex.ru>
 
         Turned on ENABLE_REQUEST_ANIMATION_FRAME by default for any port.
index 313448b..dc387d6 100644 (file)
@@ -2945,7 +2945,7 @@ if (ENABLE_ALLINONE_BUILD)
         svg/SVGAllInOne.cpp
     )
     foreach (allInOne ${allInOnes})
-        PROCESS_ALLINONE_FILE("${WebCore_SOURCES}" ${allInOne} newSources ${AllInOne})
+        PROCESS_ALLINONE_FILE("${WebCore_SOURCES}" ${allInOne} newSources FALSE)
         set(WebCore_SOURCES
             ${allInOne}
             ${newSources}
@@ -3800,6 +3800,13 @@ 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 (ENABLE_ALLINONE_BUILD)
+    message(STATUS "All-in-One DerivedSources build is enabled.")
+    PROCESS_ALLINONE_FILE("${WebCore_SOURCES}" DerivedSources.cpp newSources TRUE)
+    set(WebCore_SOURCES DerivedSources.cpp ${newSources})
+    list(APPEND WebCore_SOURCES DerivedSources.cpp)
+endif ()
+
 WEBKIT_WRAP_SOURCELIST(${WebCore_IDL_FILES} ${WebCore_SOURCES})
 WEBKIT_WRAP_SOURCELIST(${WebCoreTestSupport_IDL_FILES} ${WebCoreTestSupport_SOURCES})
 
index 3a35154..e7bb7c1 100644 (file)
@@ -1,3 +1,20 @@
+2016-03-25  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Improve CMake build performance 
+        https://bugs.webkit.org/show_bug.cgi?id=155871
+        <rdar://problem/24747822>
+
+        Reviewed by Alex Christensen.
+
+        Treat DerivedSources.cpp as an 'All-in-one' file. Pass a flag to the
+        PROCESS_ALLINONE_FILE macro so that it does not remove the contents of
+        the file, since this breaks dependency checking and generation of the
+        sources from the IDL files. Instead, include the header files in the
+        project so that all files get generated.        
+        
+        * CMakeLists.txt: Updated for 'DerivedSources.cpp'
+        * DerivedSources.cpp: Add some generated files that were missing.
+
 2016-03-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         [Fetch API] Add basic loading of resources
index 5c33255..cefe987 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008-2016 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 // This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
 
+// The following files do not work well with the new CMake system. Don't include in this file
+// #include "HTMLEntityTable.cpp"
+// #include "JSSVGElementWrapperFactory.cpp"
+// #include "PlugInsResourcesData.cpp"
+// #include "UserAgentStyleSheetsData.cpp"
+
+#include "ExceptionCodeDescription.h"
 #include "HTMLElementFactory.cpp"
-#include "HTMLEntityTable.cpp"
 #if ENABLE(WEBGL)
 #include "JSANGLEInstancedArrays.cpp"
 #endif
 #include "JSBarProp.cpp"
 #include "JSBeforeLoadEvent.cpp"
 #include "JSBeforeUnloadEvent.cpp"
+#if ENABLE(WEB_AUDIO)
+#include "JSBiquadFilterNode.cpp"
+#endif
 #include "JSBlob.cpp"
 #include "JSCanvasGradient.cpp"
 #include "JSCanvasPattern.cpp"
+#include "JSCanvasProxy.cpp"
 #include "JSCanvasRenderingContext.cpp"
 #include "JSCanvasRenderingContext2D.cpp"
 #if ENABLE(STREAMS_API)
 #include "JSByteLengthQueuingStrategy.cpp"
 #include "JSCountQueuingStrategy.cpp"
 #endif
+#if ENABLE(WEB_AUDIO)
+#include "JSChannelMergerNode.cpp"
+#include "JSChannelSplitterNode.cpp"
+#include "JSConvolverNode.cpp"
+#endif
+#include "JSChildNode.cpp"
+#if ENABLE(SUBTLE_CRYPTO)
+#include "JSCryptoKey.cpp"
+#include "JSCryptoKeyPair.cpp"
+#endif
 #if ENABLE(WEBGL)
 #include "JSEXTBlendMinMax.cpp"
 #include "JSEXTFragDepth.cpp"
 #include "JSCSSStyleRule.cpp"
 #include "JSCSSStyleSheet.cpp"
 #include "JSCSSSupportsRule.cpp"
+#include "JSCSSUnknownRule.cpp"
 #include "JSCSSValue.cpp"
 #include "JSCSSValueList.cpp"
 #include "JSCustomEvent.cpp"
 #include "JSDataTransferItem.cpp"
 #include "JSDataTransferItemList.cpp"
 #include "JSDedicatedWorkerGlobalScope.cpp"
+#if ENABLE(WEB_AUDIO)
+#include "JSDelayNode.cpp"
+#endif
+#if ENABLE(DEVICE_ORIENTATION)
+#include "JSDeviceMotionEvent.h"
 #include "JSDeviceOrientationEvent.cpp"
+#endif
+#if ENABLE(PROXIMITY_EVENTS)
+#include "JSDeviceProximityEvent.cpp"
+#endif
 #include "JSDocument.cpp"
 #include "JSDocumentFragment.cpp"
 #include "JSDocumentType.cpp"
 #include "JSDOMStringMap.cpp"
 #include "JSDOMTokenList.cpp"
 #include "JSDOMURL.cpp"
+#include "JSDOMURLMediaSource.cpp"
+#include "JSDOMURLMediaStream.cpp"
 #include "JSDOMWindow.cpp"
 #include "JSDOMWindowCSS.cpp"
+#include "JSDOMWindowFetch.cpp"
+#include "JSDOMWindowIndexedDatabase.cpp"
+#include "JSDOMWindowNotifications.cpp"
+#include "JSDOMWindowSpeechSynthesis.cpp"
+#include "JSDOMWindowWebDatabase.cpp"
 #include "JSElement.cpp"
 #include "JSErrorEvent.cpp"
 #include "JSEvent.cpp"
 #include "JSFileReaderSync.cpp"
 #include "JSFocusEvent.cpp"
 #include "JSFontFace.cpp"
+#include "JSFontFaceSet.cpp"
+#if ENABLE(WEB_AUDIO)
+#include "JSGainNode.cpp"
+#endif
 #include "JSGeolocation.cpp"
 #include "JSGeoposition.cpp"
+#include "JSGlobalEventHandlers.cpp"
 #include "JSHashChangeEvent.cpp"
 #include "JSHistory.cpp"
 #include "JSHTMLAllCollection.cpp"
 #include "JSHTMLHeadingElement.cpp"
 #include "JSHTMLHRElement.cpp"
 #include "JSHTMLHtmlElement.cpp"
+#include "JSHTMLHyperlinkElementUtils.cpp"
 #include "JSHTMLIFrameElement.cpp"
 #include "JSHTMLImageElement.cpp"
 #include "JSHTMLInputElement.cpp"
 #include "JSHTMLMapElement.cpp"
 #include "JSHTMLMarqueeElement.cpp"
 #include "JSHTMLMediaElement.cpp"
+#include "JSHTMLMediaElementMediaSession.cpp"
+#include "JSHTMLMediaElementMediaStream.cpp"
 #include "JSHTMLMenuElement.cpp"
 #include "JSHTMLMetaElement.cpp"
 #include "JSHTMLMeterElement.cpp"
 #include "JSHTMLOutputElement.cpp"
 #include "JSHTMLParagraphElement.cpp"
 #include "JSHTMLParamElement.cpp"
+#include "JSHTMLPictureElement.cpp"
 #include "JSHTMLPreElement.cpp"
 #include "JSHTMLProgressElement.cpp"
 #include "JSHTMLQuoteElement.cpp"
 #include "JSHTMLUnknownElement.cpp"
 #include "JSHTMLUListElement.cpp"
 #include "JSHTMLVideoElement.cpp"
+#if ENABLE(INDEXED_DATABASE)
 #include "JSIDBAny.cpp"
 #include "JSIDBCursor.cpp"
+#include "JSIDBCursorWithValue.cpp"
 #include "JSIDBDatabase.cpp"
 #include "JSIDBFactory.cpp"
 #include "JSIDBIndex.cpp"
 #include "JSIDBKeyRange.cpp"
 #include "JSIDBObjectStore.cpp"
+#include "JSIDBOpenDBRequest.cpp"
 #include "JSIDBRequest.cpp"
 #include "JSIDBTransaction.cpp"
+#include "JSIDBVersionChangeEvent.cpp"
+#endif
 #include "JSImageData.cpp"
 #include "JSInspectorFrontendHost.cpp"
 #include "JSKeyboardEvent.cpp"
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
 #include "JSMediaControlsHost.cpp"
 #endif
+#if ENABLE(MEDIA_STREAM)
+#include "JSMediaDeviceInfo.cpp"
+#include "JSMediaDeviceso.cpp"
+#endif
+#if ENABLE(VIDEO) && ENABLE(WEB_AUDIO)
+#include "JSMediaElementAudioSourceNode.cpp"
+#endif
 #include "JSMediaError.cpp"
 #include "JSMediaList.cpp"
 #if ENABLE(ENCRYPTED_MEDIA_V2)
 #endif
 #include "JSMediaQueryList.cpp"
 #include "JSMediaQueryListListener.cpp"
+#include "JSMediaRemoteControls.cpp"
+#include "JSMediaSession.cpp"
+#include "JSMediaSource.cpp"
+#include "JSMediaStream.cpp"
+#include "JSMediaStreamAudioDestinationNode.cpp"
+#include "JSMediaStreamAudioSourceNode.cpp"
+#include "JSMediaStreamEvent.cpp"
+#include "JSMediaStreamTrack.cpp"
+#include "JSMediaStreamTrackSourcesCallback.cpp"
+#include "JSMediaTrackConstraint.cpp"
+#include "JSMediaTrackConstraintSet.cpp"
+#include "JSMediaTrackConstraints.cpp"
+#include "JSMediaTrackSupportedConstraints.cpp"
 #include "JSMessageChannel.cpp"
 #include "JSMessageEvent.cpp"
 #include "JSMessagePort.cpp"
 #include "JSMutationRecord.cpp"
 #include "JSNamedNodeMap.cpp"
 #include "JSNavigator.cpp"
+#include "JSNavigatorBattery.cpp"
+#include "JSNavigatorContentUtils.cpp"
+#include "JSNavigatorGeolocation.cpp"
+#include "JSNavigatorMediaDevices.cpp"
+#include "JSNavigatorUserMedia.cpp"
+#include "JSNavigatorUserMediaError.cpp"
+#include "JSNavigatorVibration.cpp"
 #include "JSNode.cpp"
 #include "JSNodeFilter.cpp"
 #include "JSNodeIterator.cpp"
 #include "JSNodeList.cpp"
-#include "JSNotificationCenter.cpp"
+#include "JSNonDocumentTypeChildNode.cpp"
+#include "JSNonElementParentNode.cpp"
 #include "JSNotification.cpp"
+#include "JSNotificationCenter.cpp"
+#include "JSNotificationPermissionCallback.cpp"
 #include "JSOverflowEvent.cpp"
+#include "JSOfflineAudioCompletionEvent.cpp"
+#include "JSOfflineAudioContext.cpp"
+#include "JSOscillatorNode.cpp"
 #include "JSPageTransitionEvent.cpp"
+#include "JSPannerNode.cpp"
+#include "JSParentNode.cpp"
 #include "JSPerformance.cpp"
+#include "JSPerformanceEntry.cpp"
+#include "JSPerformanceEntryList.cpp"
+#include "JSPerformanceMark.cpp"
+#include "JSPerformanceMeasure.cpp"
 #include "JSPerformanceNavigation.cpp"
+#include "JSPerformanceResourceTiming.cpp"
 #include "JSPerformanceTiming.cpp"
+#include "JSPeriodicWave.cpp"
 #include "JSPopStateEvent.cpp"
 #include "JSPositionCallback.cpp"
 #include "JSPositionError.cpp"
 #include "JSRect.cpp"
 #include "JSRequestAnimationFrameCallback.cpp"
 #include "JSRGBColor.cpp"
+#include "JSRTCConfiguration.cpp"
+#include "JSRTCDataChannel.cpp"
+#include "JSRTCDataChannelEvent.cpp"
+#include "JSRTCDTMFSender.cpp"
+#include "JSRTCDTMFToneChangeEvent.cpp"
+#include "JSRTCIceCandidate.cpp"
+#include "JSRTCIceCandidateEvent.cpp"
+#include "JSRTCIceServer.cpp"
+#include "JSRTCPeerConnection.cpp"
+#include "JSRTCRtpReceiver.cpp"
+#include "JSRTCRtpSender.cpp"
+#include "JSRTCSessionDescription.cpp"
+#include "JSRTCStatsReport.cpp"
+#include "JSRTCStatsResponse.cpp"
+#include "JSRTCTrackEvent.cpp"
 #include "JSScreen.cpp"
+#include "JSScriptProcessorNode.cpp"
 #include "JSScriptProfile.cpp"
 #include "JSScriptProfileNode.cpp"
 #if ENABLE(CSP_NEXT)
 #include "JSSecurityPolicyViolationEvent.cpp"
 #endif
+#include "JSSourceBuffer.cpp"
+#include "JSSourceBufferList.cpp"
+#include "JSSourceInfo.cpp"
+#include "JSSpeechSynthesis.cpp"
+#include "JSSpeechSynthesisEvent.cpp"
+#include "JSSpeechSynthesisUtterance.cpp"
+#include "JSSpeechSynthesisVoice.cpp"
+#include "JSSubtleCrypto.cpp"
 #include "JSSQLError.cpp"
 #include "JSSQLException.cpp"
 #include "JSSQLResultSet.cpp"
 #include "JSSVGElement.cpp"
 #include "JSSVGEllipseElement.cpp"
 #include "JSSVGException.cpp"
+#include "JSSVGExternalResourcesRequired.cpp"
 #include "JSSVGFEBlendElement.cpp"
 #include "JSSVGFEColorMatrixElement.cpp"
 #include "JSSVGFEComponentTransferElement.cpp"
 #include "JSSVGFETileElement.cpp"
 #include "JSSVGFETurbulenceElement.cpp"
 #include "JSSVGFilterElement.cpp"
+#include "JSSVGFilterPrimitiveStandardAttributes.cpp"
+#include "JSSVGFitToViewBox.cpp"
 #include "JSSVGFontElement.cpp"
 #include "JSSVGFontFaceElement.cpp"
 #include "JSSVGFontFaceFormatElement.cpp"
 #include "JSSVGStyleElement.cpp"
 #include "JSSVGSwitchElement.cpp"
 #include "JSSVGSymbolElement.cpp"
+#include "JSSVGTests.cpp"
 #include "JSSVGTextContentElement.cpp"
 #include "JSSVGTextElement.cpp"
 #include "JSSVGTextPathElement.cpp"
 #include "JSSVGTRefElement.cpp"
 #include "JSSVGTSpanElement.cpp"
 #include "JSSVGUnitTypes.cpp"
+#include "JSSVGURIReference.cpp"
 #include "JSSVGUseElement.cpp"
 #include "JSSVGVKernElement.cpp"
 #include "JSSVGViewElement.cpp"
 #include "JSSVGZoomEvent.cpp"
 #include "JSShadowRoot.cpp"
 #include "JSStorage.cpp"
+#if ENABLE(QUOTA)
 #include "JSStorageErrorCallback.cpp"
+#endif
 #include "JSStorageEvent.cpp"
+#if ENABLE(QUOTA)
 #include "JSStorageInfo.cpp"
 #include "JSStorageQuota.cpp"
 #include "JSStorageQuotaCallback.cpp"
 #include "JSStorageUsageCallback.cpp"
+#endif
 #include "JSStringCallback.cpp"
 #include "JSStyleMedia.cpp"
 #include "JSStyleSheet.cpp"
 #include "JSTransitionEvent.cpp"
 #include "JSTreeWalker.cpp"
 #include "JSUIEvent.cpp"
+#include "JSUIRequestEvent.cpp"
+#include "JSURLUtils.cpp"
+#include "JSUserMessageHandler.cpp"
+#include "JSUserMessageHandlersNamespace.cpp"
 #include "JSValidityState.cpp"
+#include "JSVideoPlaybackQuality.cpp"
 #include "JSVoidCallback.cpp"
+#include "JSWaveShaperNode.cpp"
 #include "JSWebKitAnimationEvent.cpp"
 #include "JSWebKitCSSFilterValue.cpp"
 #include "JSWebKitCSSTransformValue.cpp"
 #include "JSWebKitCSSMatrix.cpp"
 #include "JSWebKitCSSRegionRule.cpp"
+#include "JSWebKitCSSViewportRule.cpp"
 #include "JSWebKitNamedFlow.cpp"
+#include "JSWebKitNamespace.cpp"
+#include "JSWebKitPlaybackTargetAvailabilityEvent.cpp"
 #include "JSWebKitPoint.cpp"
 #include "JSWebKitTransitionEvent.cpp"
 #include "JSWebSocket.cpp"
 #include "JSWheelEvent.cpp"
+#include "JSWindowBase64.cpp"
+#include "JSWindowEventHandlers.cpp"
+#include "JSWindowTimers.cpp"
 #include "JSWorker.cpp"
 #include "JSWorkerGlobalScope.cpp"
+#include "JSWorkerGlobalScopeFetch.cpp"
+#include "JSWorkerGlobalScopeIndexedDatabase.cpp"
+#include "JSWorkerGlobalScopeNotifications.cpp"
 #include "JSWorkerLocation.cpp"
 #include "JSWorkerNavigator.cpp"
 #include "JSXMLDocument.cpp"
 #include "JSXMLHttpRequest.cpp"
-#include "JSXMLHttpRequestException.cpp"
+#include "JSXMLHttpRequestEventTarget.cpp"
 #include "JSXMLHttpRequestProgressEvent.cpp"
 #include "JSXMLHttpRequestUpload.cpp"
 #include "JSXMLSerializer.cpp"
 #include "JSXPathNSResolver.cpp"
 #include "JSXPathResult.cpp"
 #include "JSXSLTProcessor.cpp"
-#include "PlugInsResourcesData.cpp"
-#include "UserAgentStyleSheetsData.cpp"
 
 // On MSVC, including StaticConstructors.h causes all global objects not to be
 // automatically initialized by the C runtime. This is useful in some specific
index 2ed1e09..f695dd1 100644 (file)
@@ -357,9 +357,10 @@ endmacro()
 # _file_list is a list of source files
 # _all_in_one_file is an all-in-one cpp file includes other cpp files
 # _result_file_list is the output file list
-macro(PROCESS_ALLINONE_FILE _file_list _all_in_one_file _result_file_list)
+macro(PROCESS_ALLINONE_FILE _file_list _all_in_one_file _result_file_list _no_compile)
     file(STRINGS ${_all_in_one_file} _all_in_one_file_content)
     set(${_result_file_list} ${_file_list})
+    set(_allins "")
     foreach (_line ${_all_in_one_file_content})
         string(REGEX MATCH "^#include [\"<](.*)[\">]" _found ${_line})
         if (_found)
@@ -368,7 +369,14 @@ macro(PROCESS_ALLINONE_FILE _file_list _all_in_one_file _result_file_list)
     endforeach ()
 
     foreach (_allin ${_allins})
-        string(REGEX REPLACE ";[^;]*/${_allin};" ";" _new_result "${${_result_file_list}};")
+        if (${_no_compile})
+            # For DerivedSources.cpp, we still need the derived sources to be generated, but we do not want them to be compiled
+            # individually. We add the header to the result file list so that CMake knows to keep generating the files.
+            string(REGEX REPLACE "(.*)\\.cpp" "\\1" _allin_no_ext ${_allin})
+            string(REGEX REPLACE ";([^;]*/)${_allin_no_ext}\\.cpp;" ";\\1${_allin_no_ext}.h;" _new_result "${${_result_file_list}};")
+        else ()
+            string(REGEX REPLACE ";[^;]*/${_allin};" ";" _new_result "${${_result_file_list}};")
+        endif ()
         set(${_result_file_list} ${_new_result})
     endforeach ()