Files
CMake/Tests/RunCMake/CheckSourceRuns/CheckSourceRunsSYCL.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

26 lines
585 B
CMake

set(CMAKE_EXPERIMENTAL_SYCL "c0d1fb10-2ece-420e-9d29-7d7f2b300f25")
enable_language (SYCL)
include(CheckSourceRuns)
set(SYCL 1) # test that this is tolerated
check_source_runs(SYCL "int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "SYCL check_source_runs succeeded, but should have failed.")
endif()
check_source_runs(SYCL
[=[
#include <vector>
#include <sycl/sycl.hpp>
void fake_function();
int main() {
return 0;
}
]=]
SHOULD_RUN)
if(NOT SHOULD_RUN)
message(SEND_ERROR "SYCL check_source_runs failed for valid SYCL executable.")
endif()