blob: 96119b61e1753b27907e78f1010f80c234239420 [file] [log] [blame]
# Copyright 2023 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/python.gni")
import("$dir_pw_build/python_dist.gni")
import("$dir_pw_build/python_venv.gni")
import("$dir_pw_unit_test/test.gni")
# All the targets build by default with e.g. `ninja -C out`.
group("default") {
deps = [
":applications",
":gonk_python.lint",
":gonk_python.tests",
":python.install",
]
}
group("applications") {
deps = [
"//applications/system_example(//targets/host:host_device_simulator.speed_optimized)",
"//applications/system_example(//targets/stm32f769i_disc0_stm32cube:stm32f769i_disc0_stm32cube.size_optimized)",
]
}
# Python Targets
_gonk_python_packages = [ "//tools" ]
# Pigweed Python packages to include
_pigweed_python_packages = [ "$dir_pw_env_setup:core_pigweed_python_packages" ]
_all_python_packages = _gonk_python_packages + _pigweed_python_packages
pw_python_group("gonk_python") {
python_deps = _gonk_python_packages
}
pw_python_venv("gonk_build_venv") {
path = "$root_build_dir/python-venv"
source_packages = _all_python_packages
}
# This template collects all python packages and their dependencies into a
# single super Python package for installation into the bootstrapped virtual
# environment.
pw_python_distribution("gonk_python_distribution") {
packages = _pigweed_python_packages
generate_setup_cfg = {
name = "gonk-dist"
version = "0.0.1"
append_date_to_version = true
include_default_pyproject_file = true
}
}
pw_python_pip_install("pip_install_gonk_dist") {
packages = [ ":gonk_python_distribution" ]
}
pw_python_pip_install("pip_install_gonk_editable_tools") {
packages = _gonk_python_packages
editable = true
}
pw_python_group("python") {
python_deps = [
# Generate and pip install _pigweed_python_packages
":pip_install_gonk_dist",
":pip_install_gonk_editable_tools",
]
}