-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
74 lines (57 loc) · 3.05 KB
/
CMakeLists.txt
File metadata and controls
74 lines (57 loc) · 3.05 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# Copyright (C) 2022-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
cmake_policy(SET CMP0135 NEW)
endif()
set(STACK_VERSION 1.32.1 CACHE STRING "Main project version")
project(npu-linux-driver VERSION ${STACK_VERSION})
set(BUILD_NUMBER "dev-0" CACHE STRING "Build number composed of name and unique number used as driver version")
set(BUILD_VERSION ${PROJECT_NAME}-dev-${PROJECT_VERSION}.${BUILD_NUMBER} CACHE STRING "Build version")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Supported build types: Release, Debug" FORCE)
endif()
string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE_LOWER)
message(STATUS "PROJECT_VERSION = ${PROJECT_VERSION}")
message(STATUS "BUILD_NUMBER = ${BUILD_NUMBER}")
message(STATUS "BUILD_VERSION = ${BUILD_VERSION}")
message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
configure_file(version.h.in ${CMAKE_BINARY_DIR}/include/version.h)
include_directories(SYSTEM ${CMAKE_BINARY_DIR}/include)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(ENABLE_OPENVINO_PACKAGE "Enable building the OpenVINO package" OFF)
option(ENABLE_NPU_COMPILER_BUILD "Enable building compiler in driver" OFF)
option(ENABLE_NPU_PERFETTO_BUILD "Enable building with Perfetto library" OFF)
option(ENABLE_VALIDATION_BUILD "Enable building validation tests" ON)
option(ENABLE_OFFLINE_COMPILATION_SUPPORT "Enable model compilation support for user defined device" OFF)
option(ENABLE_COMPILATION_FLAGS_OVERRIDE "Allow to override flags passed to compiler" OFF)
# The npu_elf target is picked up from the compiler package
option(ENABLE_NPU_ELF_BUILD "Enable building NPU Elf library in driver" OFF)
option(ENABLE_TOOLS_BUILD "Enable building tools" OFF)
message(STATUS "option ENABLE_NPU_COMPILER_BUILD: ${ENABLE_NPU_COMPILER_BUILD}")
message(STATUS "option ENABLE_NPU_PERFETTO_BUILD: ${ENABLE_NPU_PERFETTO_BUILD}")
message(STATUS "option ENABLE_OPENVINO_PACKAGE: ${ENABLE_OPENVINO_PACKAGE}")
message(STATUS "option ENABLE_VALIDATION_BUILD: ${ENABLE_VALIDATION_BUILD}")
message(STATUS "option ENABLE_OFFLINE_COMPILATION_SUPPORT: ${ENABLE_OFFLINE_COMPILATION_SUPPORT}")
message(STATUS "option ENABLE_COMPILATION_FLAGS_OVERRIDE: ${ENABLE_COMPILATION_FLAGS_OVERRIDE}")
message(STATUS "option ENABLE_NPU_ELF_BUILD: ${ENABLE_NPU_ELF_BUILD}")
message(STATUS "option ENABLE_TOOLS_BUILD: ${ENABLE_TOOLS_BUILD}")
include(GNUInstallDirs)
include(cmake/detect_linux_system.cmake)
include(cmake/compiler_flags.cmake)
include(cmake/sanitizer.cmake)
set(VALIDATION_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/vpu/validation")
add_subdirectory(compiler)
add_subdirectory(firmware)
add_subdirectory(third_party)
add_subdirectory(tools)
add_subdirectory(umd)
add_subdirectory(validation)
include(cmake/packaging/setup.cmake)
# You may your custom commands in .local.cmake, i.e. driver compilation, running tests.
include(${CMAKE_CURRENT_SOURCE_DIR}/.local.cmake OPTIONAL)