Skip to content

Commit 86368b2

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

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,25 @@ 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+
if(NOT DEFINED ENV{CXX})
16+
message(FATAL_ERROR "CXX environment variable is not defined")
17+
endif()
18+
19+
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
20+
message(FATAL_ERROR "ICPX compiler is required. Please set CXX to icpx.")
21+
endif()
22+
23+
include(CheckCXXCompilerFlag)
24+
check_cxx_compiler_flag(-fsycl COMPILER_SUPPORTS_FSYCL)
25+
26+
if(NOT COMPILER_SUPPORTS_FSYCL)
27+
message(FATAL_ERROR "A compiler with SYCL support is required.")
28+
endif()
29+
1430
find_package(MPI REQUIRED)
1531

1632
add_subdirectory(src)

0 commit comments

Comments
 (0)