- Revision
- 239561
- Author
- [email protected]
- Date
- 2018-12-30 13:19:09 -0800 (Sun, 30 Dec 2018)
Log Message
Add ENABLE_UNIFIED_BUILDS option to cmake ports
https://bugs.webkit.org/show_bug.cgi?id=193045
Reviewed by Don Olmstead.
.:
This patch adds ENABLE_UNIFIED_BUILDS option to cmake ports, which allows us to disable Unified Builds in WebKit.
This makes `compile_commands.json` sane when the unified builds is disabled, and various tools can use this
compilation database. For example, YouCompleteMe completion server can use it.
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/WebKitMacros.cmake:
Source/WTF:
* Scripts/generate-unified-source-bundles.rb:
Modified Paths
Diff
Modified: trunk/ChangeLog (239560 => 239561)
--- trunk/ChangeLog 2018-12-30 20:53:48 UTC (rev 239560)
+++ trunk/ChangeLog 2018-12-30 21:19:09 UTC (rev 239561)
@@ -1,3 +1,17 @@
+2018-12-28 Yusuke Suzuki <[email protected]>
+
+ Add ENABLE_UNIFIED_BUILDS option to cmake ports
+ https://bugs.webkit.org/show_bug.cgi?id=193045
+
+ Reviewed by Don Olmstead.
+
+ This patch adds ENABLE_UNIFIED_BUILDS option to cmake ports, which allows us to disable Unified Builds in WebKit.
+ This makes `compile_commands.json` sane when the unified builds is disabled, and various tools can use this
+ compilation database. For example, YouCompleteMe completion server can use it.
+
+ * Source/cmake/WebKitFeatures.cmake:
+ * Source/cmake/WebKitMacros.cmake:
+
2018-12-27 Alex Christensen <[email protected]>
Resurrect Mac CMake build
Modified: trunk/Source/WTF/ChangeLog (239560 => 239561)
--- trunk/Source/WTF/ChangeLog 2018-12-30 20:53:48 UTC (rev 239560)
+++ trunk/Source/WTF/ChangeLog 2018-12-30 21:19:09 UTC (rev 239561)
@@ -1,3 +1,12 @@
+2018-12-28 Yusuke Suzuki <[email protected]>
+
+ Add ENABLE_UNIFIED_BUILDS option to cmake ports
+ https://bugs.webkit.org/show_bug.cgi?id=193045
+
+ Reviewed by Don Olmstead.
+
+ * Scripts/generate-unified-source-bundles.rb:
+
2018-12-27 Alex Christensen <[email protected]>
Resurrect Mac CMake build
Modified: trunk/Source/WTF/Scripts/generate-unified-source-bundles.rb (239560 => 239561)
--- trunk/Source/WTF/Scripts/generate-unified-source-bundles.rb 2018-12-30 20:53:48 UTC (rev 239560)
+++ trunk/Source/WTF/Scripts/generate-unified-source-bundles.rb 2018-12-30 21:19:09 UTC (rev 239561)
@@ -45,6 +45,7 @@
puts
puts "Optional arguments:"
puts "--print-bundled-sources Print bundled sources rather than generating sources"
+ puts "--print-all-sources Print all sources rather than generating sources"
puts "--generate-xcfilelists Generate .xcfilelist files"
puts "--input-xcfilelist-path Path of the generated input .xcfilelist file"
puts "--output-xcfilelist-path Path of the generated output .xcfilelist file"
@@ -78,6 +79,7 @@
['--source-tree-path', '-s', GetoptLong::REQUIRED_ARGUMENT],
['--feature-flags', '-f', GetoptLong::REQUIRED_ARGUMENT],
['--print-bundled-sources', GetoptLong::NO_ARGUMENT],
+ ['--print-all-sources', GetoptLong::NO_ARGUMENT],
['--generate-xcfilelists', GetoptLong::NO_ARGUMENT],
['--input-xcfilelist-path', GetoptLong::REQUIRED_ARGUMENT],
['--output-xcfilelist-path', GetoptLong::REQUIRED_ARGUMENT],
@@ -98,6 +100,8 @@
arg.gsub(/\s+/, ";").split(";").map { |x| $featureFlags[x] = true }
when '--print-bundled-sources'
$mode = :PrintBundledSources
+ when '--print-all-sources'
+ $mode = :PrintAllSources
when '--generate-xcfilelists'
$mode = :GenerateXCFilelists
when '--input-xcfilelist-path'
@@ -323,6 +327,8 @@
case $mode
when :GenerateBundles, :GenerateXCFilelists
ProcessFileForUnifiedSourceGeneration(sourceFile)
+ when :PrintAllSources
+ $generatedSources << sourceFile
when :PrintBundledSources
$generatedSources << sourceFile if $bundleManagers[sourceFile.path.extname] && sourceFile.unifiable
end
Modified: trunk/Source/cmake/WebKitFeatures.cmake (239560 => 239561)
--- trunk/Source/cmake/WebKitFeatures.cmake 2018-12-30 20:53:48 UTC (rev 239560)
+++ trunk/Source/cmake/WebKitFeatures.cmake 2018-12-30 21:19:09 UTC (rev 239561)
@@ -192,6 +192,7 @@
WEBKIT_OPTION_DEFINE(ENABLE_TEXT_AUTOSIZING "Toggle automatic text size adjustment support" PRIVATE OFF)
WEBKIT_OPTION_DEFINE(ENABLE_TOUCH_EVENTS "Toggle Touch Events support" PRIVATE OFF)
WEBKIT_OPTION_DEFINE(ENABLE_TOUCH_SLIDER "Toggle Touch Slider support" PRIVATE OFF)
+ WEBKIT_OPTION_DEFINE(ENABLE_UNIFIED_BUILDS "Toggle unified builds" PRIVATE ON)
WEBKIT_OPTION_DEFINE(ENABLE_USERSELECT_ALL "Toggle user-select:all support" PRIVATE ON)
WEBKIT_OPTION_DEFINE(ENABLE_USER_MESSAGE_HANDLERS "Toggle user script message handler support" PRIVATE ON)
WEBKIT_OPTION_DEFINE(ENABLE_VARIATION_FONTS "Toggle variation fonts support" PRIVATE OFF)
Modified: trunk/Source/cmake/WebKitMacros.cmake (239560 => 239561)
--- trunk/Source/cmake/WebKitMacros.cmake 2018-12-30 20:53:48 UTC (rev 239560)
+++ trunk/Source/cmake/WebKitMacros.cmake 2018-12-30 21:19:09 UTC (rev 239561)
@@ -16,41 +16,59 @@
set(WTF_SCRIPTS_DIR "${FORWARDING_HEADERS_DIR}/wtf/Scripts")
endif ()
- execute_process(COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/generate-unified-source-bundles.rb
- "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}"
- "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR}
- "--print-bundled-sources"
- "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}"
- ${_sourceListFileTruePaths}
- RESULT_VARIABLE _resultTmp
- OUTPUT_VARIABLE _outputTmp)
+ if (ENABLE_UNIFIED_BUILDS)
+ execute_process(COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/generate-unified-source-bundles.rb
+ "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}"
+ "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR}
+ "--print-bundled-sources"
+ "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}"
+ ${_sourceListFileTruePaths}
+ RESULT_VARIABLE _resultTmp
+ OUTPUT_VARIABLE _outputTmp)
- if (${_resultTmp})
- message(FATAL_ERROR "generate-unified-source-bundles.rb exited with non-zero status, exiting")
- endif ()
+ if (${_resultTmp})
+ message(FATAL_ERROR "generate-unified-source-bundles.rb exited with non-zero status, exiting")
+ endif ()
- foreach (_sourceFileTmp IN LISTS _outputTmp)
- set_source_files_properties(${_sourceFileTmp} PROPERTIES HEADER_FILE_ONLY ON)
- list(APPEND ${_framework}_HEADERS ${_sourceFileTmp})
- endforeach ()
- unset(_sourceFileTmp)
+ foreach (_sourceFileTmp IN LISTS _outputTmp)
+ set_source_files_properties(${_sourceFileTmp} PROPERTIES HEADER_FILE_ONLY ON)
+ list(APPEND ${_framework}_HEADERS ${_sourceFileTmp})
+ endforeach ()
+ unset(_sourceFileTmp)
- execute_process(COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/generate-unified-source-bundles.rb
- "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}"
- "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR}
- "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}"
- ${_sourceListFileTruePaths}
- RESULT_VARIABLE _resultTmp
- OUTPUT_VARIABLE _outputTmp)
+ execute_process(COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/generate-unified-source-bundles.rb
+ "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}"
+ "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR}
+ "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}"
+ ${_sourceListFileTruePaths}
+ RESULT_VARIABLE _resultTmp
+ OUTPUT_VARIABLE _outputTmp)
- if (${_resultTmp})
- message(FATAL_ERROR "generate-unified-source-bundles.rb exited with non-zero status, exiting")
+ if (${_resultTmp})
+ message(FATAL_ERROR "generate-unified-source-bundles.rb exited with non-zero status, exiting")
+ endif ()
+
+ list(APPEND ${_framework}_SOURCES ${_outputTmp})
+ unset(_resultTmp)
+ unset(_outputTmp)
+ else ()
+ execute_process(COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/generate-unified-source-bundles.rb
+ "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}"
+ "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR}
+ "--print-all-sources"
+ "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}"
+ ${_sourceListFileTruePaths}
+ RESULT_VARIABLE _resultTmp
+ OUTPUT_VARIABLE _outputTmp)
+
+ if (${_resultTmp})
+ message(FATAL_ERROR "generate-unified-source-bundles.rb exited with non-zero status, exiting")
+ endif ()
+
+ list(APPEND ${_framework}_SOURCES ${_outputTmp})
+ unset(_resultTmp)
+ unset(_outputTmp)
endif ()
-
- list(APPEND ${_framework}_SOURCES ${_outputTmp})
- unset(_platformSourcesFile)
- unset(_resultTmp)
- unset(_outputTmp)
endmacro()
macro(WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS)