Changeset 207617 in webkit
- Timestamp:
- Oct 20, 2016 7:34:24 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r207585 r207617 1 2016-10-20 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [CMake] CMake does not support the dep files for implicit dependency 4 https://bugs.webkit.org/show_bug.cgi?id=161433 5 6 Reviewed by Brent Fulgham. 7 8 Created a Perl script to generate all IDL bindings for CMake. 9 This script can regenerate outdated bindings by based on the 10 supplemental dependency and dep files created by 11 '--write-dependencies' switch of generate-bindings.pl. 12 13 add_custom_target is used to invoke the script instead of 14 add_custom_command because Ninja deletes all output files before 15 executing the command in case of add_custom_command. 16 17 USES_TERMINAL option of add_custom_target has two effects: 18 1) Not buffering output of the command 19 2) Invoking the command in the special Ninja pool which inhibits parallel build 20 One needs to use CMake 3.2 or later to enable this feature. 21 22 * Source/cmake/WebKitMacros.cmake (GENERATE_BINDINGS): Included 23 ProcessorCount. Added a new argument 'target'. Use 24 add_custom_target instead of add_custom_command. Invoke the new 25 script. 26 1 27 2016-10-19 Alex Christensen <achristensen@webkit.org> 2 28 -
trunk/Source/WebCore/CMakeLists.txt
r207479 r207617 3642 3642 list(APPEND WebCoreTestSupport_IDL_FILES ${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.idl) 3643 3643 3644 GENERATE_BINDINGS( 3644 GENERATE_BINDINGS(WebCoreBindings 3645 3645 OUTPUT_SOURCE WebCore_DERIVED_SOURCES 3646 3646 INPUT_FILES ${WebCore_IDL_FILES} … … 3658 3658 --dedicatedWorkerGlobalScopeConstructorsFile ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}) 3659 3659 3660 GENERATE_BINDINGS( 3660 GENERATE_BINDINGS(WebCoreTestSupportBindings 3661 3661 OUTPUT_SOURCE WebCoreTestSupport_SOURCES 3662 3662 INPUT_FILES ${WebCoreTestSupport_IDL_FILES} … … 3666 3666 DESTINATION ${DERIVED_SOURCES_WEBCORE_DIR} 3667 3667 GENERATOR JS) 3668 3669 # WebCoreTestSupportBindings needs InternalSettingsGenerated.idl 3670 add_dependencies(WebCoreTestSupportBindings WebCoreDerivedSources) 3668 3671 3669 3672 # WebCore JS Builtins … … 3812 3815 add_library(WebCoreDerivedSources STATIC ${WebCore_DERIVED_SOURCES}) 3813 3816 set_target_properties(WebCoreDerivedSources PROPERTIES OUTPUT_NAME WebCoreDerivedSources${DEBUG_SUFFIX}) 3814 add_dependencies(WebCoreDerivedSources JavaScriptCore )3817 add_dependencies(WebCoreDerivedSources JavaScriptCore WebCoreBindings) 3815 3818 if (NOT WIN32) 3816 3819 list(APPEND WebCore_LIBRARIES WebCoreDerivedSources) … … 3843 3846 include_directories(${WebCoreTestSupport_INCLUDE_DIRECTORIES}) 3844 3847 add_library(WebCoreTestSupport ${WebCoreTestSupport_LIBRARY_TYPE} ${WebCoreTestSupport_SOURCES}) 3845 add_dependencies(WebCoreTestSupport WebCore )3848 add_dependencies(WebCoreTestSupport WebCore WebCoreTestSupportBindings) 3846 3849 target_link_libraries(WebCoreTestSupport ${WebCoreTestSupport_LIBRARIES}) 3847 3850 -
trunk/Source/WebCore/ChangeLog
r207616 r207617 1 2016-10-20 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [CMake] CMake does not support the dep files for implicit dependency 4 https://bugs.webkit.org/show_bug.cgi?id=161433 5 6 Reviewed by Brent Fulgham. 7 8 Created a Perl script to generate all IDL bindings for CMake. 9 This script can regenerate outdated bindings by based on the 10 supplemental dependency and dep files created by 11 '--write-dependencies' switch of generate-bindings.pl. 12 13 add_custom_target is used to invoke the script instead of 14 add_custom_command because Ninja deletes all output files before 15 executing the command in case of add_custom_command. 16 17 USES_TERMINAL option of add_custom_target has two effects: 18 1) Not buffering output of the command 19 2) Invoking the command in the special Ninja pool which inhibits parallel build 20 One needs to use CMake 3.2 or later to enable this feature. 21 22 * CMakeLists.txt: Specified target names for 23 GENERATE_BINDINGS. Added dependency for the targets. 24 * bindings/scripts/generate-bindings-all.pl: Added. 25 1 26 2016-10-20 Adam Jackson <ajax@redhat.com> 2 27 -
trunk/Source/cmake/WebKitMacros.cmake
r207311 r207617 1 1 include(CMakeParseArguments) 2 include(ProcessorCount) 3 ProcessorCount(PROCESSOR_COUNT) 2 4 3 5 macro(WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS) … … 44 46 endmacro() 45 47 46 # Helper macro which wraps preprocess-idls.pl and generate-bindings.pl scripts. 48 # Helper macro which wraps generate-bindings-all.pl script. 49 # target is a new target name to be added 47 50 # OUTPUT_SOURCE is a list name which will contain generated sources.(eg. WebCore_SOURCES) 48 51 # INPUT_FILES are IDL files to generate. … … 55 58 # PP_EXTRA_OUTPUT is extra outputs of preprocess-idls.pl. (optional) 56 59 # PP_EXTRA_ARGS is extra arguments for preprocess-idls.pl. (optional) 57 function(GENERATE_BINDINGS )60 function(GENERATE_BINDINGS target) 58 61 set(options) 59 62 set(oneValueArgs OUTPUT_SOURCE BASE_DIR FEATURES DESTINATION GENERATOR SUPPLEMENTAL_DEPFILE) 60 63 set(multiValueArgs INPUT_FILES IDL_INCLUDES PP_EXTRA_OUTPUT PP_EXTRA_ARGS) 61 64 cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) 62 set(binding_generator ${WEBCORE_DIR}/bindings/scripts/generate-bindings .pl)65 set(binding_generator ${WEBCORE_DIR}/bindings/scripts/generate-bindings-all.pl) 63 66 set(idl_attributes_file ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt) 64 set(id ${arg_OUTPUT_SOURCE}) 65 set(idl_files_list ${CMAKE_CURRENT_BINARY_DIR}/idl_files_${id}.tmp) 67 set(idl_files_list ${CMAKE_CURRENT_BINARY_DIR}/idl_files_${target}.tmp) 66 68 set(_supplemental_dependency) 67 69 … … 75 77 file(WRITE ${idl_files_list} ${content}) 76 78 79 set(args 80 --defines ${arg_FEATURES} 81 --generator ${arg_GENERATOR} 82 --outputDir ${arg_DESTINATION} 83 --idlFilesList ${idl_files_list} 84 --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" 85 --idlAttributesFile ${idl_attributes_file}) 77 86 if (arg_SUPPLEMENTAL_DEPFILE) 78 set(_supplemental_dependency --supplementalDependencyFile ${arg_SUPPLEMENTAL_DEPFILE}) 79 80 add_custom_command( 81 OUTPUT ${arg_SUPPLEMENTAL_DEPFILE} ${arg_PP_EXTRA_OUTPUT} 82 DEPENDS ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl ${arg_INPUT_FILES} 83 COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl --defines ${arg_FEATURES} --idlFilesList ${idl_files_list} --supplementalDependencyFile ${arg_SUPPLEMENTAL_DEPFILE} ${arg_PP_EXTRA_ARGS} 84 VERBATIM) 85 endif () 86 87 set(idl_includes) 88 foreach (dir ${arg_IDL_INCLUDES}) 89 if (IS_ABSOLUTE ${dir}) 90 list(APPEND idl_includes --include=${dir}) 87 list(APPEND args --supplementalDependencyFile ${arg_SUPPLEMENTAL_DEPFILE}) 88 endif () 89 if (PROCESSOR_COUNT) 90 list(APPEND args --numOfJobs ${PROCESSOR_COUNT}) 91 endif () 92 foreach (i IN LISTS arg_IDL_INCLUDES) 93 if (IS_ABSOLUTE ${i}) 94 list(APPEND args --include ${i}) 91 95 else () 92 list(APPEND idl_includes --include=${CMAKE_CURRENT_SOURCE_DIR}/${dir}) 93 endif () 96 list(APPEND args --include ${CMAKE_CURRENT_SOURCE_DIR}/${i}) 97 endif () 98 endforeach () 99 foreach (i IN LISTS arg_PP_EXTRA_OUTPUT) 100 list(APPEND args --ppExtraOutput ${i}) 101 endforeach () 102 foreach (i IN LISTS arg_PP_EXTRA_ARGS) 103 list(APPEND args --ppExtraArgs ${i}) 94 104 endforeach () 95 105 96 106 set(common_generator_dependencies 97 ${binding_generator} 98 ${WEBCORE_DIR}/bindings/scripts/CodeGenerator.pm 107 ${WEBCORE_DIR}/bindings/scripts/generate-bindings.pl 99 108 ${SCRIPTS_BINDINGS} 100 ${arg_SUPPLEMENTAL_DEPFILE}101 ${idl_attributes_file}102 109 ) 103 list(APPEND common_generator_dependencies ${arg_PP_EXTRA_OUTPUT})104 105 110 if (EXISTS ${WEBCORE_DIR}/bindings/scripts/CodeGenerator${arg_GENERATOR}.pm) 106 111 list(APPEND common_generator_dependencies ${WEBCORE_DIR}/bindings/scripts/CodeGenerator${arg_GENERATOR}.pm) … … 109 114 list(APPEND common_generator_dependencies ${arg_BASE_DIR}/CodeGenerator${arg_GENERATOR}.pm) 110 115 endif () 116 foreach (i IN LISTS common_generator_dependencies) 117 list(APPEND args --generatorDependency ${i}) 118 endforeach () 111 119 112 120 set(gen_sources) 121 set(gen_headers) 113 122 foreach (_file ${arg_INPUT_FILES}) 114 123 get_filename_component(_name ${_file} NAME_WE) 115 116 add_custom_command(117 OUTPUT ${arg_DESTINATION}/JS${_name}.cpp ${arg_DESTINATION}/JS${_name}.h118 MAIN_DEPENDENCY ${_file}119 DEPENDS ${common_generator_dependencies}120 COMMAND ${PERL_EXECUTABLE} ${binding_generator} --defines ${arg_FEATURES} --generator ${arg_GENERATOR} ${idl_includes} --outputDir ${arg_DESTINATION} --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" --idlAttributesFile ${idl_attributes_file} ${_supplemental_dependency} ${_file}121 WORKING_DIRECTORY ${arg_BASE_DIR}122 VERBATIM)123 124 list(APPEND gen_sources ${arg_DESTINATION}/JS${_name}.cpp) 125 list(APPEND gen_headers ${arg_DESTINATION}/JS${_name}.h) 124 126 endforeach () 125 127 set(${arg_OUTPUT_SOURCE} ${${arg_OUTPUT_SOURCE}} ${gen_sources} PARENT_SCOPE) 128 set(act_args) 129 if (${CMAKE_VERSION} VERSION_LESS 3.2) 130 set_source_files_properties(${gen_sources} ${gen_headers} PROPERTIES GENERATED 1) 131 else () 132 list(APPEND act_args 133 BYPRODUCTS ${gen_sources} ${gen_headers} 134 USES_TERMINAL 135 ) 136 endif () 137 add_custom_target(${target} 138 COMMAND ${PERL_EXECUTABLE} ${binding_generator} ${args} 139 WORKING_DIRECTORY ${arg_BASE_DIR} 140 COMMENT "Generate bindings (${target})" 141 VERBATIM ${act_args}) 126 142 endfunction() 127 143 -
trunk/Tools/ChangeLog
r207609 r207617 1 2016-10-20 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [CMake] CMake does not support the dep files for implicit dependency 4 https://bugs.webkit.org/show_bug.cgi?id=161433 5 6 Reviewed by Brent Fulgham. 7 8 Created a Perl script to generate all IDL bindings for CMake. 9 This script can regenerate outdated bindings by based on the 10 supplemental dependency and dep files created by 11 '--write-dependencies' switch of generate-bindings.pl. 12 13 add_custom_target is used to invoke the script instead of 14 add_custom_command because Ninja deletes all output files before 15 executing the command in case of add_custom_command. 16 17 USES_TERMINAL option of add_custom_target has two effects: 18 1) Not buffering output of the command 19 2) Invoking the command in the special Ninja pool which inhibits parallel build 20 One needs to use CMake 3.2 or later to enable this feature. 21 22 * DumpRenderTree/CMakeLists.txt: Specified a target name for 23 GENERATE_BINDINGS. Added dependency for the target. 24 * WebKitTestRunner/CMakeLists.txt: Ditto. 25 1 26 2016-10-20 Manuel Rego Casasnovas <rego@igalia.com> 2 27 -
trunk/Tools/DumpRenderTree/CMakeLists.txt
r207009 r207617 121 121 ) 122 122 123 GENERATE_BINDINGS( 123 GENERATE_BINDINGS(DumpRenderTreeBindings 124 124 OUTPUT_SOURCE DumpRenderTree_SOURCES 125 125 INPUT_FILES ${DumpRenderTree_IDL_FILES} … … 136 136 add_executable(DumpRenderTree ${DumpRenderTree_SOURCES}) 137 137 target_link_libraries(DumpRenderTree ${DumpRenderTree_LIBRARIES}) 138 add_dependencies(DumpRenderTree DumpRenderTreeBindings) 138 139 139 140 if (ENABLE_NETSCAPE_PLUGIN_API) -
trunk/Tools/WebKitTestRunner/CMakeLists.txt
r207009 r207617 98 98 ) 99 99 100 GENERATE_BINDINGS( 100 GENERATE_BINDINGS(WebKitTestRunnerInjectedBundleBindings 101 101 OUTPUT_SOURCE WebKitTestRunnerInjectedBundle_SOURCES 102 102 INPUT_FILES ${WebKitTestRunnerInjectedBundle_IDL_FILES} … … 107 107 GENERATOR TestRunner) 108 108 109 GENERATE_BINDINGS( 109 GENERATE_BINDINGS(WebKitTestRunnerBindings 110 110 OUTPUT_SOURCE WebKitTestRunner_SOURCES 111 111 INPUT_FILES ${WebKitTestRunner_IDL_FILES} … … 123 123 add_library(TestRunnerInjectedBundle SHARED ${WebKitTestRunnerInjectedBundle_SOURCES}) 124 124 target_link_libraries(TestRunnerInjectedBundle ${WebKitTestRunner_LIBRARIES}) 125 add_dependencies(TestRunnerInjectedBundle WebKitTestRunnerInjectedBundleBindings) 125 126 126 127 add_executable(WebKitTestRunner ${WebKitTestRunner_SOURCES}) 127 128 target_link_libraries(WebKitTestRunner ${WebKitTestRunner_LIBRARIES}) 129 add_dependencies(WebKitTestRunner WebKitTestRunnerBindings) 128 130 129 131 if (NOT APPLE)
Note: See TracChangeset
for help on using the changeset viewer.