forked from amd/xdna-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (41 loc) · 1.77 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
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2022-2024, Advanced Micro Devices, Inc. All rights reserved.
cmake_minimum_required(VERSION 3.19.0)
project("amd-xdna")
set(PROJECT_DESCRIPTION "AMD XDNA driver and SHIM for Linux")
if (DEFINED ENV{XRT_PLUGIN_VERSION_PATCH})
SET(XRT_PLUGIN_VERSION_PATCH $ENV{XRT_PLUGIN_VERSION_PATCH})
else(DEFINED $ENV{XRT_PLUGIN_VERSION_PATCH})
SET(XRT_PLUGIN_VERSION_PATCH 0)
endif(DEFINED ENV{XRT_PLUGIN_VERSION_PATCH})
# Set install component that will be packaged
set(XDNA_COMPONENT "amdxdna" CACHE STRING "XDNA component name")
# Bring in xrt git submodule before include any local directories
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/xrt.cmake)
# version.cmake create XRT_PLUGIN_VERSION_STRING
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/version.cmake)
# For saving all built artifacts for quick testing purpose
# Should be redirected/prefixed by DESTDIR in make command line
# Can only be used with cmake install() command
set(XDNA_BIN_DIR /bins)
add_subdirectory(src)
# By default, build/build.sh downloads binaries to build/amdxdna_bins/
set(AMDXDNA_BINS_DIR ${CMAKE_BINARY_DIR}/../amdxdna_bins)
# Add common NPU support files
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools/bins/dpu_sequence/
DESTINATION xrt/${XDNA_COMPONENT}/bins/dpu_sequence
COMPONENT ${XDNA_COMPONENT}
FILES_MATCHING
PATTERN "*.txt" # dpu sequences are txt files
)
# Add Phoenix NPU support files
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools/bins/
DESTINATION xrt/${XDNA_COMPONENT}/bins
COMPONENT ${XDNA_COMPONENT}
FILES_MATCHING
PATTERN "*.xclbin"
)
set(XRT_SUBMOD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xrt)
set(XRT_SUBMOD_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/xrt)
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/pkg.cmake)
add_subdirectory(test)