From 717acddd1efe088665513dbd330c7cb02ed8d686 Mon Sep 17 00:00:00 2001 From: Kacper Stefanski <56044375+haichangsi@users.noreply.github.com> Date: Mon, 13 Nov 2023 09:52:51 +0100 Subject: [PATCH] add user-friendly compiler checks to the CMakelists.txt (#8) --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b9b8e7..7aa8b36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,20 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) project( distributed_ranges_tutorial + LANGUAGES CXX VERSION 0.1 DESCRIPTION "Distributed ranges tutorial") +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag(-fsycl COMPILER_SUPPORTS_FSYCL) + +if(NOT COMPILER_SUPPORTS_FSYCL) + message( + FATAL_ERROR + "A compiler with SYCL support is required. Configure Intel(R) oneAPI DPC++/C++ or any other compiler with SYCL support in your system." + ) +endif() + find_package(MPI REQUIRED) add_subdirectory(src)