WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
144394
[CMake] Automatically expose WTF_USE_FOO to the build when USE_FOO is exposed
https://bugs.webkit.org/show_bug.cgi?id=144394
Summary
[CMake] Automatically expose WTF_USE_FOO to the build when USE_FOO is exposed
Martin Robinson
Reported
2015-04-29 09:58:35 PDT
When options are presented to the user they are presented in the form USE_FOO, but the WTF USE(...) macro expects WTF_USE_FOO. We can automatically expose WTF_USE_FOO to make some things simpler.
Attachments
Patch
(3.74 KB, patch)
2015-04-29 10:22 PDT
,
Martin Robinson
no flags
Details
Formatted Diff
Diff
Patch
(3.99 KB, patch)
2015-04-29 10:35 PDT
,
Martin Robinson
no flags
Details
Formatted Diff
Diff
Patch
(4.15 KB, patch)
2015-04-30 08:53 PDT
,
Martin Robinson
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Martin Robinson
Comment 1
2015-04-29 10:22:22 PDT
Created
attachment 251964
[details]
Patch
Michael Catanzaro
Comment 2
2015-04-29 10:28:24 PDT
Nits: You should mention in the changelog that this fixes USE_REDIRECTED_XCOMPOSITE_WINDOW after yesterday's commit, since that's a significant consequence of the change. Also, the comment "when we forget" implies that exposing WTF_USE_WHATEVER is best practice, but after this change I don't see any reason to do that anymore.
Martin Robinson
Comment 3
2015-04-29 10:35:29 PDT
Created
attachment 251966
[details]
Patch
Martin Robinson
Comment 4
2015-04-29 16:34:58 PDT
(In reply to
comment #2
)
> Nits: > > You should mention in the changelog that this fixes > USE_REDIRECTED_XCOMPOSITE_WINDOW after yesterday's commit, since that's a > significant consequence of the change. > > Also, the comment "when we forget" implies that exposing WTF_USE_WHATEVER is > best practice, but after this change I don't see any reason to do that > anymore.
Thanks for the comments. I have updated the patch with your suggestions.
Carlos Garcia Campos
Comment 5
2015-04-30 00:44:04 PDT
Comment on
attachment 251966
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=251966&action=review
> Source/cmake/OptionsGTK.cmake:378 > set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
I guess you can remove SET_AND_EXPOSE_TO_BUILD(WTF_USE_LIBHYPHEN 1)
> Source/cmake/WebKitFeatures.cmake:314 > + _ADD_CONFIGURATION_LINE_TO_HEADER_STRING(_file_contents ${_variable_name} ${_variable_name}) > + > + # WebKit looks for WTF_USE_FOO when calling the USE(FOO) macro. Automatically exposing > + # this definition when USE_FOO is exposed, prevents us from having to expose both (or > + # forgetting to do so). > + string(FIND ${_variable_name} "USE_" _use_string_location) > + if (${_use_string_location} EQUAL 0) > + _ADD_CONFIGURATION_LINE_TO_HEADER_STRING(_file_contents ${_variable_name} "WTF_${_variable_name}")
This duplicates the USE macros in the cmakeconfig.h, with and without the WTF prefix, but I guess only the prefixed one is useful. I guess we could move the previous _ADD_CONFIGURATION_LINE_TO_HEADER_STRING to and else() here.
Martin Robinson
Comment 6
2015-04-30 08:47:04 PDT
(In reply to
comment #5
)
> Comment on
attachment 251966
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=251966&action=review
> > > Source/cmake/OptionsGTK.cmake:378 > > set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom) > > I guess you can remove SET_AND_EXPOSE_TO_BUILD(WTF_USE_LIBHYPHEN 1) >
Yes, this patch was written before libhyphen integration was complete. :)
> > Source/cmake/WebKitFeatures.cmake:314 > > + _ADD_CONFIGURATION_LINE_TO_HEADER_STRING(_file_contents ${_variable_name} ${_variable_name}) > > + > > + # WebKit looks for WTF_USE_FOO when calling the USE(FOO) macro. Automatically exposing > > + # this definition when USE_FOO is exposed, prevents us from having to expose both (or > > + # forgetting to do so). > > + string(FIND ${_variable_name} "USE_" _use_string_location) > > + if (${_use_string_location} EQUAL 0) > > + _ADD_CONFIGURATION_LINE_TO_HEADER_STRING(_file_contents ${_variable_name} "WTF_${_variable_name}") > > This duplicates the USE macros in the cmakeconfig.h, with and without the > WTF prefix, but I guess only the prefixed one is useful. I guess we could > move the previous _ADD_CONFIGURATION_LINE_TO_HEADER_STRING to and else() > here.
I waffled a bit on this, so your approach is probably fine too.
Martin Robinson
Comment 7
2015-04-30 08:53:21 PDT
(In reply to
comment #6
)
> > This duplicates the USE macros in the cmakeconfig.h, with and without the > > WTF prefix, but I guess only the prefixed one is useful. I guess we could > > move the previous _ADD_CONFIGURATION_LINE_TO_HEADER_STRING to and else() > > here. > > I waffled a bit on this, so your approach is probably fine too.
Actually, this isn't possible because there is at least one exception. USE_SYSTEM_MALLOC shouldn't have the prefix. I think it's safer to expose both for now.
Martin Robinson
Comment 8
2015-04-30 08:53:43 PDT
Created
attachment 252060
[details]
Patch
Carlos Garcia Campos
Comment 9
2015-04-30 09:01:31 PDT
Comment on
attachment 252060
[details]
Patch Hopefully USE won't require the WTF prefix eventually.
Martin Robinson
Comment 10
2015-04-30 09:18:22 PDT
Comment on
attachment 252060
[details]
Patch Clearing flags on attachment: 252060 Committed
r183626
: <
http://trac.webkit.org/changeset/183626
>
Martin Robinson
Comment 11
2015-04-30 09:18:26 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug