Skip to content

Commit 873d1c8

Browse files
committed
build: enable SYCL warnings on Linux
Some versions of DPC++ compiler pass paths to SYCL headers as user include paths (`-I`) rather than system paths (`-isystem`). This makes host compiler to report warnings encountered in the SYCL headers, such as deprecated warnings, even if warned API is not actually used in the program. We expect that this issue will be addressed in the later version of DPC++ compiler. To workaround the issue we wrap paths to SYCL headers in `-isystem`. disable_ut disable_e2e disable_distributed Signed-off-by: Dmitry Rogozhkin <[email protected]>
1 parent 6e5af1e commit 873d1c8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cmake/BuildFlags.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"
3636
list(APPEND SYCL_HOST_FLAGS -fPIC)
3737
list(APPEND SYCL_HOST_FLAGS -std=c++17)
3838
list(APPEND SYCL_HOST_FLAGS -Wunused-variable)
39-
# SYCL headers warnings
40-
list(APPEND SYCL_HOST_FLAGS -Wno-deprecated-declarations)
41-
list(APPEND SYCL_HOST_FLAGS -Wno-deprecated)
42-
list(APPEND SYCL_HOST_FLAGS -Wno-attributes)
39+
# Some versions of DPC++ compiler pass paths to SYCL headers as user include paths (`-I`) rather
40+
# than system paths (`-isystem`). This makes host compiler to report warnings encountered in the
41+
# SYCL headers, such as deprecated warnings, even if warned API is not actually used in the program.
42+
# We expect that this issue will be addressed in the later version of DPC++ compiler. To workaround
43+
# the issue we wrap paths to SYCL headers in `-isystem`.
44+
foreach(FLAGS IN LISTS SYCL_INCLUDE_DIR)
45+
list(APPEND SYCL_HOST_FLAGS "-isystem ${FLAGS}")
46+
endforeach()
47+
# Excluding warnings which flood the compilation output
48+
# TODO: fix warnings in the source code and then reenable them in compilation
4349
list(APPEND SYCL_HOST_FLAGS -Wno-sign-compare)
4450
endif()
4551

0 commit comments

Comments
 (0)