Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit bb9a0f9

Browse files
committed
update
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
1 parent 6cf598e commit bb9a0f9

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

build2cmake/src/templates/xpu/preamble.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,16 @@ if(ICX_COMPILER AND ICPX_COMPILER)
1212
string(REGEX MATCH "[0-9]+\\.[0-9]+" DPCPP_VERSION "${ICPX_VERSION_OUTPUT}")
1313
set(DPCPP_VERSION "${DPCPP_VERSION}" CACHE STRING "DPCPP major.minor version")
1414
set(CMAKE_C_COMPILER ${ICX_COMPILER})
15-
set(CMAKE_CXX_COMPILER ${ICPX_COMPILER})
16-
message(STATUS "Using Intel SYCL C++ compiler: ${ICPX_COMPILER} and C compiler: ${ICX_COMPILER} Version: ${DPCPP_VERSION}")
15+
16+
# On Windows, use icx (MSVC-compatible) for C++ to work with Ninja generator
17+
# On Linux, use icpx (GNU-compatible) for C++
18+
if(WIN32)
19+
set(CMAKE_CXX_COMPILER ${ICX_COMPILER})
20+
message(STATUS "Using Intel SYCL C++ compiler: ${ICX_COMPILER} and C compiler: ${ICX_COMPILER} Version: ${DPCPP_VERSION} (Windows MSVC-compatible mode)")
21+
else()
22+
set(CMAKE_CXX_COMPILER ${ICPX_COMPILER})
23+
message(STATUS "Using Intel SYCL C++ compiler: ${ICPX_COMPILER} and C compiler: ${ICX_COMPILER} Version: ${DPCPP_VERSION}")
24+
endif()
1725
else()
1826
message(FATAL_ERROR "Intel SYCL C++ compiler (icpx) and/or C compiler (icx) not found. Please install Intel oneAPI toolkit.")
1927
endif()

scripts/windows/builder.ps1

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -551,15 +551,6 @@ try {
551551
throw "Metal backend is not supported on Windows. Metal is only available on macOS."
552552
}
553553

554-
if ($Backend -and $Backend.ToLower() -eq 'xpu') {
555-
# Set Intel compilers for Windows XPU builds (icx is MSVC-compatible)
556-
if ($env:OS -eq 'Windows_NT') {
557-
$env:CXX = 'icx'
558-
$env:CC = 'icx'
559-
Write-Status "Set CXX=icx and CC=icx for Windows XPU build" -Type Info
560-
}
561-
}
562-
563554
$options = @{
564555
Force = $Force.IsPresent
565556
OpsId = $OpsId

0 commit comments

Comments
 (0)