diff options
author | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2022-09-30 16:42:50 +0100 |
---|---|---|
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2022-10-25 16:36:45 +0000 |
commit | f9efe0ddf865c55d28bcaa203fefffa94bf09b42 (patch) | |
tree | 928da5f68dafd7e5a0dee05a75f2f6fcd52df170 /driver_library/CMakeLists.txt | |
parent | 569aa558f5e7638852a928feede1f21e7323f664 (diff) | |
download | ethos-u-linux-driver-stack-f9efe0ddf865c55d28bcaa203fefffa94bf09b42.tar.gz |
Added Python interface for Arm Ethos-U NPU driver library.22.11-rc1
Python `ethosu_driver` could be built as part of Arm Ethos-U Linux
driver library CMake flow.
See driver_library/python/README.md for more details.
Change-Id: I177a890add5c13df9a839f4f43621f972afe5ab1
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'driver_library/CMakeLists.txt')
-rw-r--r-- | driver_library/CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/driver_library/CMakeLists.txt b/driver_library/CMakeLists.txt index 375192f..4c247ae 100644 --- a/driver_library/CMakeLists.txt +++ b/driver_library/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2020,2022 Arm Limited. +# SPDX-FileCopyrightText: Copyright 2020, 2022 Arm Limited and/or its affiliates <open-source-office@arm.com> # # SPDX-License-Identifier: Apache-2.0 # @@ -18,6 +18,9 @@ cmake_minimum_required(VERSION 3.0.2) +option(BUILD_PYTHON_WHL "Build Python wheel package" OFF) +option(BUILD_PYTHON_SRC "Build Python source package" OFF) + # set the project name and version project("driver_library" VERSION 1.0.0 LANGUAGES C CXX) @@ -28,9 +31,15 @@ add_library(ethosu STATIC "src/ethosu.cpp") target_include_directories(ethosu PUBLIC "include") set_target_properties(ethosu PROPERTIES PUBLIC_HEADER "include/ethosu.hpp") set_target_properties(ethosu PROPERTIES VERSION ${PROJECT_VERSION}) +set_target_properties(ethosu PROPERTIES POSITION_INDEPENDENT_CODE ON) # Install library and public headers install(TARGETS ethosu LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib" PUBLIC_HEADER DESTINATION "include") + +## Build Python bindings +if (BUILD_PYTHON_WHL OR BUILD_PYTHON_SRC) + add_subdirectory(python) +endif() |