Skip to content

Commit f3ae0bc

Browse files
committed
Fix oneTBB flags for Windows SYCL clang builds
1 parent dea1192 commit f3ae0bc

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

3rdparty/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@ option(TBB_EXAMPLES "Build TBB examples" OFF)
1010
set(TBB_STRICT OFF CACHE BOOL "Treat compiler warnings as errors")
1111

1212
# Configure TBB with unified settings
13+
set(_itlabai_restore_msvc FALSE)
14+
if(ITLABAI_ENABLE_SYCL AND WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
15+
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC" AND NOT MSVC)
16+
# oneTBB keys off MSVC here; clang++ with the MSVC target otherwise gets
17+
# non-Windows flags such as -fPIC.
18+
set(_itlabai_restore_msvc TRUE)
19+
set(MSVC TRUE)
20+
endif()
1321
add_subdirectory(TBB)
22+
if(_itlabai_restore_msvc)
23+
unset(MSVC)
24+
endif()
1425

1526
# Create a unified TBB interface target
1627
if(NOT TARGET TBB_unified)

0 commit comments

Comments
 (0)