diff --git a/Tools/TestWebKitAPI/CMakeLists.txt b/Tools/TestWebKitAPI/CMakeLists.txt index 492872d0009c..a772d19e0dd7 100644 --- a/Tools/TestWebKitAPI/CMakeLists.txt +++ b/Tools/TestWebKitAPI/CMakeLists.txt @@ -1,4 +1,10 @@ set(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI") +set(TestWebKitAPI_DISABLED_WARNINGS + -Wno-dangling-else + -Wno-sign-compare + -Wno-undef + -Wno-unused-parameter +) macro(WEBKIT_TEST _target) WEBKIT_EXECUTABLE(${_target}) @@ -9,10 +15,7 @@ macro(WEBKIT_TEST _target) ) if (COMPILER_IS_GCC_OR_CLANG) - WEBKIT_ADD_TARGET_CXX_FLAGS(${_target} -Wno-dangling-else - -Wno-sign-compare - -Wno-undef - -Wno-unused-parameter) + WEBKIT_ADD_TARGET_CXX_FLAGS(${_target} ${TestWebKitAPI_DISABLED_WARNINGS}) endif () endmacro() @@ -345,10 +348,7 @@ if (ENABLE_WEBKIT) target_link_libraries(TestWebKitAPIBase PRIVATE WebKit::WebKit WebKit::gtest) if (COMPILER_IS_GCC_OR_CLANG) - WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIBase -Wno-dangling-else - -Wno-sign-compare - -Wno-undef - -Wno-unused-parameter) + WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIBase ${TestWebKitAPI_DISABLED_WARNINGS} -Wno-deprecated-declarations) endif () set(TestWebKitAPIInjectedBundle_SOURCES @@ -399,10 +399,7 @@ if (ENABLE_WEBKIT) target_link_libraries(TestWebKitAPIInjectedBundle PRIVATE WebKit::WebKit WebKit::gtest) if (COMPILER_IS_GCC_OR_CLANG) - WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIInjectedBundle -Wno-dangling-else - -Wno-sign-compare - -Wno-undef - -Wno-unused-parameter) + WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIInjectedBundle ${TestWebKitAPI_DISABLED_WARNINGS}) endif () WEBKIT_EXECUTABLE_DECLARE(TestWebKit) diff --git a/Tools/TestWebKitAPI/Tests/WebCore/IntSizeTests.cpp b/Tools/TestWebKitAPI/Tests/WebCore/IntSizeTests.cpp index 08a995777dac..e5c289c0ca53 100644 --- a/Tools/TestWebKitAPI/Tests/WebCore/IntSizeTests.cpp +++ b/Tools/TestWebKitAPI/Tests/WebCore/IntSizeTests.cpp @@ -189,9 +189,8 @@ TEST(IntSize, TransposedSize) TEST(IntSize, Casting) { - WebCore::IntSize test(1024, 768); - #if USE(CG) + WebCore::IntSize test(1024, 768); CGSize cgSize = test; EXPECT_FLOAT_EQ(1024.0f, cgSize.width);