Skip to content

Commit ffaaa35

Browse files
[SYCL] Suppress warnings for Google Test (#5807)
This patch suppresses warnings which came from Google Test sources when compiling DPC++ RT unit tests. Now unit tests are buildable with -Werror=on option
1 parent 8924fcc commit ffaaa35

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sycl/unittests/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ foreach(flag_var
77
string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}")
88
endforeach()
99

10+
# suppress warnings which came from Google Test sources
11+
if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
12+
add_compile_options("-Wno-suggest-override")
13+
endif()
14+
check_cxx_compiler_flag("-Winconsistent-missing-override" SYCL_CXX_SUPPORTS_INCONSISTENT_MISSING_OVERRIDE_FLAG)
15+
# make CMake variable unique for SYCL toolchain by adding SYCL_ prefix to make sure there
16+
# are no variable overrides in the future if LLVM introduces CXX_SUPPORTS_INCONSISTENT_MISSING_OVERRIDE_FLAG
17+
if (SYCL_CXX_SUPPORTS_INCONSISTENT_MISSING_OVERRIDE_FLAG)
18+
add_compile_options("-Wno-inconsistent-missing-override")
19+
endif()
20+
1021
string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)
1122

1223
include(AddSYCLUnitTest)

0 commit comments

Comments
 (0)