blob: 7ec8ed0b6b0c7be723ef0b082496e017e735be44 [file] [log] [blame]
# Copyright 2021 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_android_toolchain/android.gni")
import("$dir_pw_log/backend.gni")
import("$dir_pw_sys_io/backend.gni")
if (pw_android_toolchain_NDK_PATH != "") {
import("$dir_pw_android_toolchain/generate_toolchain.gni")
import("$dir_pw_android_toolchain/toolchains.gni")
_target_config = {
# Configuration options for Pigweed executable targets.
pw_build_EXECUTABLE_TARGET_TYPE = "executable"
# Facade backends
pw_assert_BACKEND = dir_pw_assert_basic
pw_chrono_SYSTEM_CLOCK_BACKEND = "$dir_pw_chrono_stl:system_clock"
pw_chrono_SYSTEM_TIMER_BACKEND = "$dir_pw_chrono_stl:system_timer"
pw_log_BACKEND = dir_pw_log_basic
pw_sync_BINARY_SEMAPHORE_BACKEND =
"$dir_pw_sync_stl:binary_semaphore_backend"
pw_sync_CONDITION_VARIABLE_BACKEND =
"$dir_pw_sync_stl:condition_variable_backend"
pw_sync_COUNTING_SEMAPHORE_BACKEND =
"$dir_pw_sync_stl:counting_semaphore_backend"
pw_sync_MUTEX_BACKEND = "$dir_pw_sync_stl:mutex_backend"
pw_sync_TIMED_MUTEX_BACKEND = "$dir_pw_sync_stl:timed_mutex_backend"
pw_sync_INTERRUPT_SPIN_LOCK_BACKEND = "$dir_pw_sync_stl:interrupt_spin_lock"
pw_sync_THREAD_NOTIFICATION_BACKEND =
"$dir_pw_sync:binary_semaphore_thread_notification_backend"
pw_sync_TIMED_THREAD_NOTIFICATION_BACKEND =
"$dir_pw_sync:binary_semaphore_timed_thread_notification_backend"
pw_sys_io_BACKEND = dir_pw_sys_io_stdio
pw_thread_ID_BACKEND = "$dir_pw_thread_stl:id"
pw_thread_SLEEP_BACKEND = "$dir_pw_thread_stl:sleep"
pw_thread_THREAD_BACKEND = "$dir_pw_thread_stl:thread"
pw_thread_YIELD_BACKEND = "$dir_pw_thread_stl:yield"
pw_build_LINK_DEPS = []
pw_build_LINK_DEPS += [
"$dir_pw_assert:impl",
"$dir_pw_log:impl",
]
}
_toolchain_properties = {
}
_target_default_configs = []
pw_target_toolchain_android = {
_excluded_members = [
"defaults",
"name",
]
debug = {
name = "android_debug"
_toolchain_base = pw_toolchain_android.debug
forward_variables_from(_toolchain_base, "*", _excluded_members)
forward_variables_from(_toolchain_properties, "*")
defaults = {
forward_variables_from(_toolchain_base.defaults, "*")
forward_variables_from(_target_config, "*")
default_configs += _target_default_configs
}
}
speed_optimized = {
name = "android_speed_optimized"
_toolchain_base = pw_toolchain_android.speed_optimized
forward_variables_from(_toolchain_base, "*", _excluded_members)
forward_variables_from(_toolchain_properties, "*")
defaults = {
forward_variables_from(_toolchain_base.defaults, "*")
forward_variables_from(_target_config, "*")
default_configs += _target_default_configs
}
}
size_optimized = {
name = "android_size_optimized"
_toolchain_base = pw_toolchain_android.size_optimized
forward_variables_from(_toolchain_base, "*", _excluded_members)
forward_variables_from(_toolchain_properties, "*")
defaults = {
forward_variables_from(_toolchain_base.defaults, "*")
forward_variables_from(_target_config, "*")
default_configs += _target_default_configs
}
}
}
# This list just contains the members of the above scope for convenience to make
# it trivial to generate all the toolchains in this file via a
# `pw_generate_android_toolchains` target.
pw_target_toolchain_android_list = [
pw_target_toolchain_android.debug,
pw_target_toolchain_android.speed_optimized,
pw_target_toolchain_android.size_optimized,
]
}