Skip to content

Commit 1d0ac05

Browse files
authored
[SYCL] Fix Unified Runtime build failure on Windows (#8683)
Unified runtime build fails on Windows because of several problems. Add cxx and c flags in cmake file to fix those issues.
1 parent 091481d commit 1d0ac05

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@ if (NOT DEFINED UNIFIED_RUNTIME_LIBRARY OR NOT DEFINED UNIFIED_RUNTIME_INCLUDE_D
1515
# Disable errors from warnings while building the UR.
1616
# And remember origin flags before doing that.
1717
set(CMAKE_CXX_FLAGS_BAK "${CMAKE_CXX_FLAGS}")
18-
if (UNIX)
18+
if(WIN32)
19+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX-")
20+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX-")
21+
# FIXME: Unified runtime build fails with /DUNICODE
22+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /UUNICODE")
23+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /UUNICODE")
24+
# USE_Z7 forces use of /Z7 instead of /Zi which is broken with sccache
25+
set(USE_Z7 ON)
26+
else()
1927
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
28+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error")
2029
endif()
2130

2231
# No need to build tests from unified-runtime

0 commit comments

Comments
 (0)