Bug 103101 - [CMake] Allow user specified compiler flags to take precedence
Summary: [CMake] Allow user specified compiler flags to take precedence
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2012-11-22 23:40 PST by Laszlo Gombos
Modified: 2012-11-26 00:32 PST (History)
4 users (show)

See Also:

proposed patch (3.23 KB, patch)
2012-11-23 00:09 PST, Laszlo Gombos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

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.