Bug 91575

Summary: [CMAKE] Remove duplicated #ifdef guard in CMakeLists.txt
Product: WebKit Reporter: Gyuyoung Kim <gyuyoung.kim>
Component: New BugsAssignee: Gyuyoung Kim <gyuyoung.kim>
Status: RESOLVED FIXED    
Severity: Normal CC: dbates, paroga, rakuco, rwlbuis, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 96346    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Gyuyoung Kim 2012-07-17 20:20:40 PDT
CMake files have used ENABLE_XXX macro. However, almost source and idl file are already protected by #ifdef. So, we don't need to guard in CMake files again.
Comment 1 Gyuyoung Kim 2012-07-17 20:22:39 PDT
Created attachment 152909 [details]
Patch
Comment 2 Gyuyoung Kim 2012-07-17 21:05:04 PDT
CC'ing Patrick
Comment 3 Gyuyoung Kim 2012-07-17 22:37:51 PDT
Created attachment 152927 [details]
Patch
Comment 4 Patrick R. Gansterer 2012-07-17 23:08:45 PDT
Comment on attachment 152927 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=152927&action=review

> Source/WebCore/ChangeLog:9
> +        So, we don't need to guard them in CMake files again.

Guarding them in CMake helps in not compiling a bunch of unneeded files. This way you increase the compile time. So I'm not the biggest fan of this change, but it's ok.

> Source/WebCore/CMakeLists.txt:566
> +    # FIXME: The BlackBerry port doesn't support generating DOM bindings from the SVG IDL files.
> +    # For now, we explicitly demarcate the SVG IDL files so that the BlackBerry port can skip them
> +    # during DOM binding generation. See <https://bugs.webkit.org/show_bug.cgi?id=72773>.

How do you skip them now?
Comment 5 Gyuyoung Kim 2012-07-17 23:48:39 PDT
(In reply to comment #4)
> (From update of attachment 152927 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=152927&action=review
> 
> > Source/WebCore/ChangeLog:9
> > +        So, we don't need to guard them in CMake files again.
> 
> Guarding them in CMake helps in not compiling a bunch of unneeded files. This way you increase the compile time. So I'm not the biggest fan of this change, but it's ok.

Yes, those source files already have #ifdef guard by themselves. So, I thought CMake doesn't need to protect them again. In my humble opinion, if we continue to use existing method, CMake file can be littered by ENABLE_XXX.

> > Source/WebCore/CMakeLists.txt:566
> > +    # FIXME: The BlackBerry port doesn't support generating DOM bindings from the SVG IDL files.
> > +    # For now, we explicitly demarcate the SVG IDL files so that the BlackBerry port can skip them
> > +    # during DOM binding generation. See <https://bugs.webkit.org/show_bug.cgi?id=72773>.
> 
> How do you skip them now?

Should I fix it in this patch ?  This patch is also to move ENABLE(SVG) to main .idl file list because .idl files can be used when SVG is enabled as below,

 interface [
        Conditional=SVG
Comment 6 Gyuyoung Kim 2012-07-17 23:49:33 PDT
CC'ing dbate as well.
Comment 7 Patrick R. Gansterer 2012-07-17 23:53:24 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > (From update of attachment 152927 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=152927&action=review
> > 
> > > Source/WebCore/ChangeLog:9
> > > +        So, we don't need to guard them in CMake files again.
> > 
> > Guarding them in CMake helps in not compiling a bunch of unneeded files. This way you increase the compile time. So I'm not the biggest fan of this change, but it's ok.
> 
> Yes, those source files already have #ifdef guard by themselves. So, I thought CMake doesn't need to protect them again. In my humble opinion, if we continue to use existing method, CMake file can be littered by ENABLE_XXX.

Both solutions are ok for me, so decide yourself. ;-)

> > > Source/WebCore/CMakeLists.txt:566
> > > +    # FIXME: The BlackBerry port doesn't support generating DOM bindings from the SVG IDL files.
> > > +    # For now, we explicitly demarcate the SVG IDL files so that the BlackBerry port can skip them
> > > +    # during DOM binding generation. See <https://bugs.webkit.org/show_bug.cgi?id=72773>.
> > 
> > How do you skip them now?
> 
> Should I fix it in this patch ?  This patch is also to move ENABLE(SVG) to main .idl file list because .idl files can be used when SVG is enabled as below,
> 
>  interface [
>         Conditional=SVG

Only the IDL generation for SVG is disabled! AFAIK Blackberry builds with ENABLE(SVG), but only skips IDL generation for it. (Since the CPP IDL generator can not handle SVG IDL files correctly ATM)
Comment 8 Gyuyoung Kim 2012-07-18 00:00:13 PDT
(In reply to comment #7)

> Only the IDL generation for SVG is disabled! AFAIK Blackberry builds with ENABLE(SVG), but only skips IDL generation for it. (Since the CPP IDL generator can not handle SVG IDL files correctly ATM)

I would decide how to handle SVG idl files after getting comments from blackberry port guys. CC'ing Antonio and Rob as well.
Comment 9 Patrick R. Gansterer 2012-07-18 00:06:03 PDT
(In reply to comment #8)
> (In reply to comment #7)
> 
> > Only the IDL generation for SVG is disabled! AFAIK Blackberry builds with ENABLE(SVG), but only skips IDL generation for it. (Since the CPP IDL generator can not handle SVG IDL files correctly ATM)
> 
> I would decide how to handle SVG idl files after getting comments from blackberry port guys. CC'ing Antonio and Rob as well.

The easiest way is to split it again in WebCore_IDL and WebCore_SVG_IDL files. So PlatformBlackberry.cmake can handle them again in a special way. See http://trac.webkit.org/browser/trunk/Source/WebCore/PlatformBlackBerry.cmake?rev=122250#L315
Comment 10 Gyuyoung Kim 2012-07-18 02:53:46 PDT
Created attachment 152973 [details]
Patch
Comment 11 Gyuyoung Kim 2012-07-18 02:54:53 PDT
(In reply to comment #9)
> The easiest way is to split it again in WebCore_IDL and WebCore_SVG_IDL files. So PlatformBlackberry.cmake can handle them again in a special way. See http://trac.webkit.org/browser/trunk/Source/WebCore/PlatformBlackBerry.cmake?rev=122250#L315

Thank you, I also think WebCore_SVG_IDL_FILES is good solution. Patch is updated according to your comment.
Comment 12 Gyuyoung Kim 2012-07-18 18:46:42 PDT
Patrick, could you give informal review ?
Comment 13 Patrick R. Gansterer 2012-07-18 18:50:28 PDT
(In reply to comment #12)
> Patrick, could you give informal review ?

I didn't check if the copy&paste of the file names is correct, since the compiler can do this better. ;-)
Otherwise I'm still not a big fan (since the increase of compile time, which might can be changed somehow else), but looks ok to me now.
Comment 14 Gyuyoung Kim 2012-07-18 18:59:39 PDT
(In reply to comment #13)
> (In reply to comment #12)
> > Patrick, could you give informal review ?
> 
> I didn't check if the copy&paste of the file names is correct, since the compiler can do this better. ;-)
> Otherwise I'm still not a big fan (since the increase of compile time, which might can be changed somehow else), but looks ok to me now.

Yes, this patch should be updated after getting r+. I will not make any problems by this patch. Thank you.
Comment 15 Dirk Pranke 2012-07-18 19:13:39 PDT
Comment on attachment 152973 [details]
Patch

This is pretty much a rubber stamp, but it looks reasonable. Please watch this when it lands :).
Comment 16 Gyuyoung Kim 2012-07-18 19:45:23 PDT
Created attachment 153164 [details]
Patch
Comment 17 Gyuyoung Kim 2012-07-18 21:05:30 PDT
Comment on attachment 153164 [details]
Patch

According to my build time measurement with / without this patch, there is no build time difference. So, I land this patch.


Antonio and Rob Buis,

Could you please check if blackberry port can be built after landing this patch ?
Comment 18 WebKit Review Bot 2012-07-18 21:36:37 PDT
Comment on attachment 153164 [details]
Patch

Clearing flags on attachment: 153164

Committed r123068: <http://trac.webkit.org/changeset/123068>
Comment 19 WebKit Review Bot 2012-07-18 21:36:43 PDT
All reviewed patches have been landed.  Closing bug.