-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathCMakeLists.txt
26 lines (22 loc) · 921 Bytes
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.5)
project(LibreCuda CXX)
option(BUILD_LIBRECUDA_DRVIER_API_STATIC_LIB "Build the LibreCUDA driverapi as a static library" ON)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
if (COMPILER_SUPPORTS_CXX17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
add_definitions(-DCOMPILEDWITHC17)
message(STATUS "Using flag -std=c++17.")
else ()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.")
endif ()
if (NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/third_party/ELFIO/elfio")
message("-- ELFIO not found, fetching ELFIO...")
execute_process(COMMAND git submodule update --init)
add_subdirectory(third_party/ELFIO)
else ()
message("-- ELFIO found.")
add_subdirectory(third_party/ELFIO)
endif ()
add_subdirectory(driverapi)
add_subdirectory(tests)