RESOLVED FIXED 90258
[CMAKE] Add GENERATE_BINDINGS macro to share the codes which use generate-bindings.pl.
https://bugs.webkit.org/show_bug.cgi?id=90258
Summary [CMAKE] Add GENERATE_BINDINGS macro to share the codes which use generate-bin...
Ryuan Choi
Reported 2012-06-29 01:44:12 PDT
As following a comment of Bug 87659, add GENERATE_BINDINGS macro to share the codes which use generate-bindings.pl.
Attachments
Patch (6.38 KB, patch)
2012-06-29 01:52 PDT, Ryuan Choi
no flags
Patch (11.51 KB, patch)
2012-07-03 17:48 PDT, Ryuan Choi
no flags
Ryuan Choi
Comment 1 2012-06-29 01:52:48 PDT
Raphael Kubo da Costa (:rakuco)
Comment 2 2012-06-29 11:49:33 PDT
Comment on attachment 150114 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=150114&action=review Thanks for working on this. git grep tells me that UseV8.cmake and PlatformBlackBerry.cmake also call generate-bindings.pl, it'd be good if you could generalize the macro to be able to use it in those files as well. > Source/WebCore/UseJSC.cmake:319 > + SET(WEBCORE_IDL_FILES_LIST ${WEBCORE_IDL_FILES_LIST} ${WEBCORE_DIR}/${_idl}) Is this change related? > Source/WebCore/UseJSC.cmake:324 > + SET(WebCoreTestSupport_IDL_FILES_LIST ${WebCoreTestSupport_IDL_FILES_LIST} ${WEBCORE_DIR}/${_idl}) Ditto. > Source/cmake/WebKitMacros.cmake:27 > +MACRO (GENERATE_BINDINGS _output_sources _input_files _idl_includes _destination _generator) It'd be good if you could add some documentation here. See, for example, http://trac.webkit.org/browser/trunk/Source/cmake/FindGStreamer.cmake#L54 > Source/cmake/WebKitMacros.cmake:34 > + FOREACH (f ${ARGN}) > + IF (NOT _supplemental_dependency) > + SET(_supplemental_dependency --supplementalDependencyFile ${f}) > + ENDIF () > + ENDFOREACH () So there can be at most one supplemental dependency?
Ryuan Choi
Comment 3 2012-06-29 19:32:50 PDT
(In reply to comment #2) > (From update of attachment 150114 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=150114&action=review > > Thanks for working on this. git grep tells me that UseV8.cmake and PlatformBlackBerry.cmake also call generate-bindings.pl, it'd be good if you could generalize the macro to be able to use it in those files as well. > OK, I will. > > Source/WebCore/UseJSC.cmake:319 > > + SET(WEBCORE_IDL_FILES_LIST ${WEBCORE_IDL_FILES_LIST} ${WEBCORE_DIR}/${_idl}) > > Is this change related? > > > Source/WebCore/UseJSC.cmake:324 > > + SET(WebCoreTestSupport_IDL_FILES_LIST ${WebCoreTestSupport_IDL_FILES_LIST} ${WEBCORE_DIR}/${_idl}) > > Ditto. > It's because GENERATE_BINDINGS macro should not limit the IDL path to WEBCORE_DIR. As alternatives, I think that each item in IDL lists should be absolute path. I can create new bug for it because this changes are huge. > > Source/cmake/WebKitMacros.cmake:27 > > +MACRO (GENERATE_BINDINGS _output_sources _input_files _idl_includes _destination _generator) > > It'd be good if you could add some documentation here. See, for example, http://trac.webkit.org/browser/trunk/Source/cmake/FindGStreamer.cmake#L54 Thank you, I will try. > > > Source/cmake/WebKitMacros.cmake:34 > > + FOREACH (f ${ARGN}) > > + IF (NOT _supplemental_dependency) > > + SET(_supplemental_dependency --supplementalDependencyFile ${f}) > > + ENDIF () > > + ENDFOREACH () > > So there can be at most one supplemental dependency? I don't know supplemental dependency enough. But If I am right, there is one supplemental dependency file. I want that this is an optional argument.
Raphael Kubo da Costa (:rakuco)
Comment 4 2012-07-02 20:46:25 PDT
Comment on attachment 150114 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=150114&action=review >>> Source/WebCore/UseJSC.cmake:319 >>> + SET(WEBCORE_IDL_FILES_LIST ${WEBCORE_IDL_FILES_LIST} ${WEBCORE_DIR}/${_idl}) >> >> Is this change related? > > It's because GENERATE_BINDINGS macro should not limit the IDL path to WEBCORE_DIR. > > As alternatives, I think that each item in IDL lists should be absolute path. > I can create new bug for it because this changes are huge. Well, it's easier to adjust the macro. If necessary, pass the base directory the script should be called from. >>> Source/cmake/WebKitMacros.cmake:34 >>> + ENDFOREACH () >> >> So there can be at most one supplemental dependency? > > I don't know supplemental dependency enough. > But If I am right, there is one supplemental dependency file. > I want that this is an optional argument. If there can be only one (please check the supplemental page in Trac), you can simply get the first argument instead of needlessly looping.
Ryuan Choi
Comment 5 2012-07-03 17:48:49 PDT
Dominik Röttsches (drott)
Comment 6 2012-07-04 04:52:08 PDT
I gave this a try, works fine locally.
Ryuan Choi
Comment 7 2012-07-04 05:30:04 PDT
(In reply to comment #4) > (From update of attachment 150114 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=150114&action=review > > >>> Source/WebCore/UseJSC.cmake:319 > >>> + SET(WEBCORE_IDL_FILES_LIST ${WEBCORE_IDL_FILES_LIST} ${WEBCORE_DIR}/${_idl}) > >> > >> Is this change related? > > > > It's because GENERATE_BINDINGS macro should not limit the IDL path to WEBCORE_DIR. > > > > As alternatives, I think that each item in IDL lists should be absolute path. > > I can create new bug for it because this changes are huge. > > Well, it's easier to adjust the macro. If necessary, pass the base directory the script should be called from. OK, I tried like you mentioned. > > >>> Source/cmake/WebKitMacros.cmake:34 > >>> + ENDFOREACH () > >> > >> So there can be at most one supplemental dependency? > > > > I don't know supplemental dependency enough. > > But If I am right, there is one supplemental dependency file. > > I want that this is an optional argument. > > If there can be only one (please check the supplemental page in Trac), you can simply get the first argument instead of needlessly looping. I checked scripts and supplemental file can be only one. I changed little bit.
Rob Buis
Comment 8 2012-07-04 08:14:19 PDT
Comment on attachment 150698 [details] Patch LGTM.
WebKit Review Bot
Comment 9 2012-07-04 08:25:54 PDT
Comment on attachment 150698 [details] Patch Clearing flags on attachment: 150698 Committed r121857: <http://trac.webkit.org/changeset/121857>
WebKit Review Bot
Comment 10 2012-07-04 08:25:59 PDT
All reviewed patches have been landed. Closing bug.
Dominik Röttsches (drott)
Comment 11 2012-07-05 06:55:52 PDT
Could it be that this causes the generated sources now to be always rebuilt?
Ryuan Choi
Comment 12 2012-07-05 07:13:51 PDT
(In reply to comment #11) > Could it be that this causes the generated sources now to be always rebuilt? Oops I found typo. MAIN_DEPEND'D'ENCY. I will fix it.
Note You need to log in before you can comment on or make changes to this bug.