Skip to content

Commit 2c22d15

Browse files
Fix build of sycl examples under Windows (#1948)
1 parent 360e017 commit 2c22d15

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

examples/sycl/tbb-async-sycl/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2020-2025 Intel Corporation
2+
# Copyright (c) 2026 UXL Foundation Contributors
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -16,7 +17,8 @@ cmake_minimum_required (VERSION 3.4)
1617

1718
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
1819
set(CMAKE_CXX_COMPILER "icx-cl")
19-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl")
20+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl /EHsc")
21+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsycl")
2022
else()
2123
set(CMAKE_CXX_COMPILER "icpx")
2224
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl")

examples/sycl/tbb-resumable-tasks-sycl/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2020-2025 Intel Corporation
2+
# Copyright (c) 2026 UXL Foundation Contributors
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -16,8 +17,8 @@ cmake_minimum_required (VERSION 3.4)
1617

1718
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
1819
set(CMAKE_CXX_COMPILER "icx-cl")
19-
set(CMAKE_CXX_FLAGS "fsycl")
20-
20+
set(CMAKE_CXX_FLAGS "-fsycl")
21+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsycl")
2122
else()
2223
set(CMAKE_CXX_COMPILER "icpx")
2324
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl")

examples/sycl/tbb-task-sycl/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2020-2025 Intel Corporation
2+
# Copyright (c) 2026 UXL Foundation Contributors
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -16,8 +17,8 @@ cmake_minimum_required (VERSION 3.4)
1617

1718
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
1819
set(CMAKE_CXX_COMPILER "icx-cl")
19-
set(CMAKE_CXX_FLAGS "fsycl")
20-
20+
set(CMAKE_CXX_FLAGS "-fsycl /EHsc")
21+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsycl")
2122
else()
2223
set(CMAKE_CXX_COMPILER "icpx")
2324
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl")

0 commit comments

Comments
 (0)