Skip to content

Commit 962b2c7

Browse files
committed
add user-friendly compiler checks to the CMakelists.txt
1 parent 7db7b6c commit 962b2c7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
88

99
project(
1010
distributed_ranges_tutorial
11+
LANGUAGES CXX
1112
VERSION 0.1
1213
DESCRIPTION "Distributed ranges tutorial")
1314

15+
include(CheckCXXCompilerFlag)
16+
check_cxx_compiler_flag(-fsycl COMPILER_SUPPORTS_FSYCL)
17+
18+
if(NOT COMPILER_SUPPORTS_FSYCL)
19+
message(
20+
FATAL_ERROR
21+
"A compiler with SYCL support is required. Configure Intel(R) oneAPI DPC++/C++ or any other compiler with SYCL support in your system."
22+
)
23+
endif()
24+
1425
find_package(MPI REQUIRED)
1526

1627
add_subdirectory(src)

0 commit comments

Comments
 (0)