Skip to content

Commit 3c7afff

Browse files
[SYCL][CMake] Check for compiler support before adding a flag (#7051)
Fixes the issue introduced by #7022.
1 parent 7038ec5 commit 3c7afff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sycl/source/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,11 @@ if (MSVC)
210210
set(SYCL_EXTRA_OPTS "/MD")
211211
endif()
212212

213-
# See https://github.com/llvm/llvm-project/issues/58295.
214-
set_source_files_properties(device_selector.cpp PROPERTIES COMPILE_FLAGS -fsemantic-interposition)
213+
check_cxx_compiler_flag(-fsemantic-interposition HAS_SEMANTIC_INTERPOSITION_FLAG)
214+
if (HAS_SEMANTIC_INTERPOSITION_FLAG)
215+
# See https://github.com/llvm/llvm-project/issues/58295.
216+
set_source_files_properties(device_selector.cpp PROPERTIES COMPILE_FLAGS -fsemantic-interposition)
217+
endif()
215218

216219
if (WIN32)
217220
set(LIB_NAME "sycl${SYCL_MAJOR_VERSION}")

0 commit comments

Comments
 (0)