RESOLVED FIXED 95377
[CMake] Suppress ANGLE compilation warnings
https://bugs.webkit.org/show_bug.cgi?id=95377
Summary [CMake] Suppress ANGLE compilation warnings
Rob Buis
Reported 2012-08-29 14:05:16 PDT
By compiling ANGLE into a static library (like wtf.a) we can set our compile rules for these files (partly C code) and so suppress warnings that we see now on ToT. One example of a warning that is hard to fix is the usage of -Wno-c++0x-compat on a C source.
Attachments
Patch (2.67 KB, patch)
2012-08-29 14:14 PDT, Rob Buis
no flags
Patch (4.94 KB, patch)
2012-08-30 09:20 PDT, Rob Buis
no flags
Patch (5.04 KB, patch)
2012-08-30 11:19 PDT, Rob Buis
no flags
Patch (5.08 KB, patch)
2012-08-30 12:09 PDT, Rob Buis
tonikitoo: review+
Rob Buis
Comment 1 2012-08-29 14:14:32 PDT
Raphael Kubo da Costa (:rakuco)
Comment 2 2012-08-29 15:08:16 PDT
Comment on attachment 161314 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=161314&action=review > Source/WebCore/CMakeLists.txt:2970 > + SET_TARGET_PROPERTIES (${ANGLESupport_LIBRARY_NAME} PROPERTIES COMPILE_FLAGS "-fPIC -fvisibility=hidden -fno-exceptions -fno-strict-aliasing") Doesn't this cause problems if one's not using gcc/clang?
Raphael Kubo da Costa (:rakuco)
Comment 3 2012-08-29 15:09:20 PDT
(In reply to comment #0) > By compiling ANGLE into a static library (like wtf.a) we can set our compile rules for these files (partly C code) and so suppress warnings that we see now on ToT. One example of a warning that is hard to fix is the usage of -Wno-c++0x-compat on a C source. Do you mean some of the .cpp files there are actually C source code?
Rob Buis
Comment 4 2012-08-29 17:12:22 PDT
(In reply to comment #3) > (In reply to comment #0) > > By compiling ANGLE into a static library (like wtf.a) we can set our compile rules for these files (partly C code) and so suppress warnings that we see now on ToT. One example of a warning that is hard to fix is the usage of -Wno-c++0x-compat on a C source. > > Do you mean some of the .cpp files there are actually C source code? I meant, ANGLE contain C sources, so using -Wno-c++0x-compat on them gives a warning. An example is ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/atom.c.
Rob Buis
Comment 5 2012-08-29 17:13:14 PDT
(In reply to comment #3) > (In reply to comment #0) > > By compiling ANGLE into a static library (like wtf.a) we can set our compile rules for these files (partly C code) and so suppress warnings that we see now on ToT. One example of a warning that is hard to fix is the usage of -Wno-c++0x-compat on a C source. > > Do you mean some of the .cpp files there are actually C source code? (In reply to comment #2) > (From update of attachment 161314 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=161314&action=review > > > Source/WebCore/CMakeLists.txt:2970 > > + SET_TARGET_PROPERTIES (${ANGLESupport_LIBRARY_NAME} PROPERTIES COMPILE_FLAGS "-fPIC -fvisibility=hidden -fno-exceptions -fno-strict-aliasing") > > Doesn't this cause problems if one's not using gcc/clang? Possibly yes. I'll look into that tomorrow, thanks.
Raphael Kubo da Costa (:rakuco)
Comment 6 2012-08-29 18:14:30 PDT
(In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #0) > > > By compiling ANGLE into a static library (like wtf.a) we can set our compile rules for these files (partly C code) and so suppress warnings that we see now on ToT. One example of a warning that is hard to fix is the usage of -Wno-c++0x-compat on a C source. > > > > Do you mean some of the .cpp files there are actually C source code? > > I meant, ANGLE contain C sources, so using -Wno-c++0x-compat on them gives a warning. An example is ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/atom.c. Oh, I see. That makes sense; perhaps we should not set the target's COMPILE_FLAGS in WebKitHelper.cmake's WEBKIT_SET_EXTRA_COMPILER_FLAGS and just change CMAKE_C{XX}_FLAGS instead. Splitting ANGLE into a separate library is a good change regardless of that, though.
Rob Buis
Comment 7 2012-08-30 09:20:14 PDT
Raphael Kubo da Costa (:rakuco)
Comment 8 2012-08-30 10:17:08 PDT
Comment on attachment 161490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=161490&action=review > Source/cmake/WebKitHelpers.cmake:7 > + IF (${ARGC} MATCHES "1") > + SET (_allowCXXWarnings "allow") > + ENDIF () Now that we require CMake 2.8.3, we can parse keyword arguments more easily. I recommend taking a look at the CMakeParseArguments module, we could then accept something like WEBKIT_SET_EXTRA_COMPILER_FLAGS(foo IGNORE_WARNINGS FALSE).
Raphael Kubo da Costa (:rakuco)
Comment 9 2012-08-30 10:28:32 PDT
(In reply to comment #8) > we could then accept something like WEBKIT_SET_EXTRA_COMPILER_FLAGS(foo IGNORE_WARNINGS FALSE). ... Or even WEBKIT_SET_EXTRA_COMPILER_FLAGS(foo IGNORE_WARNINGS), which is more compact and makes more sense.
Rob Buis
Comment 10 2012-08-30 10:35:58 PDT
(In reply to comment #9) > (In reply to comment #8) > > we could then accept something like WEBKIT_SET_EXTRA_COMPILER_FLAGS(foo IGNORE_WARNINGS FALSE). > > ... Or even WEBKIT_SET_EXTRA_COMPILER_FLAGS(foo IGNORE_WARNINGS), which is more compact and makes more sense. I agree, this sounds like a lot cleaner way to do it, thanks. Patch upcoming.
Rob Buis
Comment 11 2012-08-30 11:19:13 PDT
Raphael Kubo da Costa (:rakuco)
Comment 12 2012-08-30 11:54:55 PDT
Comment on attachment 161521 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=161521&action=review > Source/cmake/WebKitHelpers.cmake:4 > + SET(options IGNORECXX_WARNINGS) Nit: Since there's only one argument right now it could be simpler to just pass it directly to CMAKE_PARSE_ARGUMENTS() instead of setting a variable for that. > Source/cmake/WebKitHelpers.cmake:5 > + CMAKE_PARSE_ARGUMENTS("OPTION" "${options}" "" "" ${ARGN} ) You likely need to INCLUDE(CMakeParseArguments), for example at the beginning of the file, before using this macro. One minor nit is that there's an extra space character before the closing ')'.
Rob Buis
Comment 13 2012-08-30 12:09:28 PDT
Antonio Gomes
Comment 14 2012-08-30 12:38:21 PDT
Comment on attachment 161528 [details] Patch rs=me
Rob Buis
Comment 15 2012-08-30 13:15:08 PDT
Note You need to log in before you can comment on or make changes to this bug.