aboutsummaryrefslogtreecommitdiff
path: root/driver_library/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'driver_library/CMakeLists.txt')
-rw-r--r--driver_library/CMakeLists.txt11
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()