Files
CMake/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSYCL.cmake
Vito Gamberini f69754ad63 SYCL: Initial language implementation
Add experimental support for SYCL under an experimental gate. The
IntelLLVM and Adaptivecpp compilers are recognized, as well as upstream
Clang with libsycl support.

Fixes: #27219, #27905
2026-10-07 11:43:31 -04:00

17 lines
472 B
CMake

set(CMAKE_EXPERIMENTAL_SYCL "c0d1fb10-2ece-420e-9d29-7d7f2b300f25")
enable_language (SYCL)
include(CheckCompilerFlag)
set(SYCL 1) # test that this is tolerated
check_compiler_flag(SYCL "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid SYCL compile flag didn't fail.")
endif()
check_compiler_flag(SYCL "-DFOO" SHOULD_WORK)
if(NOT SHOULD_WORK)
message(SEND_ERROR "${CMAKE_SYCL_COMPILER_ID} compiler flag '-DFOO' check failed")
endif()