-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
66 lines (53 loc) · 1.78 KB
/
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
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.18)
project(Proteus
VERSION 0.1.0
LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
option(PROTEUS_ENABLE_HIP "Enable HIP" OFF)
option(PROTEUS_ENABLE_CUDA "Enable CUDA" OFF)
option(PROTEUS_ENABLE_DEBUG "Enable debugging output" OFF)
option(ENABLE_TIME_TRACING "Enable time tracing for the JIT engine" OFF)
option(BUILD_SHARED "Builds the JIT library as shared" OFF)
option(ENABLE_TESTS "Enable tests" ON)
if(PROTEUS_ENABLE_HIP)
add_definitions("-DPROTEUS_ENABLE_HIP")
find_package(hip REQUIRED CONFIG)
message(STATUS "HIP Version: ${hip_VERSION}")
if(hip_VERSION VERSION_LESS "5.7.1")
message(FATAL_ERROR "HIP found: ${hip_VERSION} is less than minimum required version 5.7.1.")
endif()
endif()
if(PROTEUS_ENABLE_CUDA)
add_definitions("-DPROTEUS_ENABLE_CUDA")
find_package(CUDAToolkit 12 REQUIRED)
endif()
if(PROTEUS_ENABLE_DEBUG)
add_definitions("-DPROTEUS_ENABLE_DEBUG")
endif()
include(cmake/SetupLLVM.cmake)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
add_subdirectory(lib)
add_subdirectory(pass)
if(ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/proteusConfig.cmake.in"
"${PROJECT_BINARY_DIR}/proteusConfig.cmake"
INSTALL_DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/proteus)
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/proteusConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion)
install(EXPORT proteusTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/proteus)
install(FILES
"${PROJECT_BINARY_DIR}/proteusConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/proteusConfig.cmake"
DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/proteus)