Bug 103101

Summary: [CMake] Allow user specified compiler flags to take precedence
Product: WebKit Reporter: Laszlo Gombos <laszlo.gombos>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: gyuyoung.kim, paroga, rakuco, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch none

Description Laszlo Gombos 2012-11-22 23:40:29 PST
Compiler/linker flags (e.g. CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, CMAKE_SHARED_LINKER_FLAGS) specified by the build system should be always prepended to the user specified flags to make sure that the user specified flags take precedence.

As an example - for the efl port - if the user would specify "build-webkit --efl --cmakearg="-DCMAKE_CXX_FLAGS=-Werror=unused-parameter" to treat unused-parameter warnings as errors, it would not work because the gcc command line would look something like the following:

"... --Werror=unused-parameter ... -Werror -Wno-error=unused-parameter" and -Wno-error=unused-parameter takes precedence and the user specified option is ignored.

This is also an attempt to not only fix this bug, but also make the code more consistent by always prepending compiler/linker flags in cmake files (as sometimes the code appends, sometimes prepends currently).
Comment 1 Laszlo Gombos 2012-11-23 00:09:38 PST
Created attachment 175741 [details]
proposed patch
Comment 2 Brent Fulgham 2012-11-26 00:06:31 PST
Comment on attachment 175741 [details]
proposed patch

R=me
Comment 3 WebKit Review Bot 2012-11-26 00:32:05 PST
Comment on attachment 175741 [details]
proposed patch

Clearing flags on attachment: 175741

Committed r135688: <http://trac.webkit.org/changeset/135688>
Comment 4 WebKit Review Bot 2012-11-26 00:32:09 PST
All reviewed patches have been landed.  Closing bug.