forked from hidet-org/hidet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (29 loc) · 1.12 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
cmake_minimum_required(VERSION 3.19)
project(hidet C CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# config hidet
if(EXISTS "${CMAKE_BINARY_DIR}/config.cmake")
include(${CMAKE_BINARY_DIR}/config.cmake)
else()
include(${CMAKE_SOURCE_DIR}/config.cmake)
endif()
set(CMAKE_BUILD_TYPE ${HIDET_BUILD_TYPE})
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
# add hidet_runtime target
add_library(hidet_runtime SHARED
src/hidet/runtime/cuda_context.cpp
src/hidet/runtime/cpu_context.cpp
src/hidet/runtime/callbacks.cpp
src/hidet/runtime/logging.cpp
src/hidet/runtime/symbols.cpp
)
target_include_directories(hidet_runtime PRIVATE ${CMAKE_SOURCE_DIR}/include /usr/include)
set_target_properties(hidet_runtime PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# add hidet target
add_library(hidet SHARED
src/hidet/packedfunc.cpp
)
target_include_directories(hidet PRIVATE ${CMAKE_SOURCE_DIR}/include)
set_target_properties(hidet PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
target_link_libraries(hidet "-Wl,--no-as-needed" hidet_runtime)