This repository was archived by the owner on Jan 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (37 loc) · 1.31 KB
/
CMakeLists.txt
File metadata and controls
52 lines (37 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required (VERSION 3.2.2)
project (SyclSTL)
enable_testing()
option(PARALLEL_STL_BENCHMARKS "Build the internal benchmarks" OFF)
option(USE_COMPUTECPP "Use ComputeCPP" ON)
message(STATUS " Path to CMAKE source directory: ${CMAKE_SOURCE_DIR} ")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
find_package(Threads REQUIRED)
set(CMAKE_CXX_STANDARD 14)
if (USE_COMPUTECPP)
message(STATUS " Using ComputeCpp CMake")
include(FindOpenCL)
include(FindComputeCpp)
add_definitions(-DSYCL_PSTL_USE_OLD_ALGO)
set(SYCL_LIBRARY ${COMPUTECPP_RUNTIME_LIBRARY})
set(SYCL_INCLUDE_DIRS ${ComputeCpp_INCLUDE_DIRS})
else()
message(STATUS " Using triSYCL CMake")
include(FindTriSYCL)
set(SYCL_INCLUDE_DIRS ${TRISYCL_INCLUDE_DIR})
set(SYCL_LIBRARY) # Not needed for TriSYCL
endif()
# PSTL specific
include_directories("include")
# Function to build a file
function(build_file file)
get_filename_component(SOURCE_NAME ${file} NAME_WE)
message(STATUS " Adding ${SOURCE_NAME} ")
add_executable(${SOURCE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${file} )
add_sycl_to_target(TARGET ${SOURCE_NAME} SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endfunction()
add_subdirectory (src)
add_subdirectory (examples)
add_subdirectory (tests)
if (PARALLEL_STL_BENCHMARKS)
add_subdirectory (benchmarks)
endif()