Skip to content

Commit 893f17c

Browse files
author
Sergey Kanaev
committed
[SYCL] Enable all warnings while building SYCL runtime
Signed-off-by: Sergey Kanaev <[email protected]>
1 parent cfcc6ac commit 893f17c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

sycl/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,21 @@ set(CMAKE_CXX_EXTENSIONS OFF)
88
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
99
option(SYCL_ENABLE_WERROR "Treat all warnings as errors in SYCL project" OFF)
1010

11+
# enable all warnings by default
12+
if (MSVC)
13+
set(CMAKE_CXX_FLAGS "/W4 ${CMAKE_CXX_FLAGS}")
14+
else ()
15+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-deprecated-declarations")
16+
endif()
17+
1118
if(SYCL_ENABLE_WERROR)
1219
if(MSVC)
13-
set(CMAKE_CXX_FLAGS "/W4 /WX ${CMAKE_CXX_FLAGS}")
20+
set(CMAKE_CXX_FLAGS "/WX ${CMAKE_CXX_FLAGS}")
1421
add_definitions(
1522
-wd4996 # Suppress 'function': was declared deprecated'
1623
)
1724
else()
18-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Wno-deprecated-declarations")
25+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
1926
endif()
2027
endif()
2128

0 commit comments

Comments
 (0)