1# Copyright 2021 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15import("//build_overrides/pigweed.gni") 16 17import("$dir_pw_android_toolchain/android.gni") 18import("$dir_pw_log/backend.gni") 19import("$dir_pw_sys_io/backend.gni") 20 21if (pw_android_toolchain_NDK_PATH != "") { 22 import("$dir_pw_android_toolchain/generate_toolchain.gni") 23 import("$dir_pw_android_toolchain/toolchains.gni") 24 25 _target_config = { 26 # Configuration options for Pigweed executable targets. 27 pw_build_EXECUTABLE_TARGET_TYPE = "executable" 28 29 # Facade backends 30 pw_assert_BACKEND = dir_pw_assert_basic 31 pw_chrono_SYSTEM_CLOCK_BACKEND = "$dir_pw_chrono_stl:system_clock" 32 pw_chrono_SYSTEM_TIMER_BACKEND = "$dir_pw_chrono_stl:system_timer" 33 pw_log_BACKEND = dir_pw_log_basic 34 pw_sync_BINARY_SEMAPHORE_BACKEND = 35 "$dir_pw_sync_stl:binary_semaphore_backend" 36 pw_sync_CONDITION_VARIABLE_BACKEND = 37 "$dir_pw_sync_stl:condition_variable_backend" 38 pw_sync_COUNTING_SEMAPHORE_BACKEND = 39 "$dir_pw_sync_stl:counting_semaphore_backend" 40 pw_sync_MUTEX_BACKEND = "$dir_pw_sync_stl:mutex_backend" 41 pw_sync_TIMED_MUTEX_BACKEND = "$dir_pw_sync_stl:timed_mutex_backend" 42 pw_sync_INTERRUPT_SPIN_LOCK_BACKEND = "$dir_pw_sync_stl:interrupt_spin_lock" 43 pw_sync_THREAD_NOTIFICATION_BACKEND = 44 "$dir_pw_sync:binary_semaphore_thread_notification_backend" 45 pw_sync_TIMED_THREAD_NOTIFICATION_BACKEND = 46 "$dir_pw_sync:binary_semaphore_timed_thread_notification_backend" 47 pw_sys_io_BACKEND = dir_pw_sys_io_stdio 48 pw_thread_ID_BACKEND = "$dir_pw_thread_stl:id" 49 pw_thread_SLEEP_BACKEND = "$dir_pw_thread_stl:sleep" 50 pw_thread_THREAD_BACKEND = "$dir_pw_thread_stl:thread" 51 pw_thread_YIELD_BACKEND = "$dir_pw_thread_stl:yield" 52 53 pw_build_LINK_DEPS = [] 54 pw_build_LINK_DEPS += [ 55 "$dir_pw_assert:impl", 56 "$dir_pw_log:impl", 57 ] 58 } 59 60 _toolchain_properties = { 61 } 62 63 _target_default_configs = [] 64 65 pw_target_toolchain_android = { 66 _excluded_members = [ 67 "defaults", 68 "name", 69 ] 70 71 debug = { 72 name = "android_debug" 73 _toolchain_base = pw_toolchain_android.debug 74 forward_variables_from(_toolchain_base, "*", _excluded_members) 75 forward_variables_from(_toolchain_properties, "*") 76 defaults = { 77 forward_variables_from(_toolchain_base.defaults, "*") 78 forward_variables_from(_target_config, "*") 79 default_configs += _target_default_configs 80 } 81 } 82 83 speed_optimized = { 84 name = "android_speed_optimized" 85 _toolchain_base = pw_toolchain_android.speed_optimized 86 forward_variables_from(_toolchain_base, "*", _excluded_members) 87 forward_variables_from(_toolchain_properties, "*") 88 defaults = { 89 forward_variables_from(_toolchain_base.defaults, "*") 90 forward_variables_from(_target_config, "*") 91 default_configs += _target_default_configs 92 } 93 } 94 95 size_optimized = { 96 name = "android_size_optimized" 97 _toolchain_base = pw_toolchain_android.size_optimized 98 forward_variables_from(_toolchain_base, "*", _excluded_members) 99 forward_variables_from(_toolchain_properties, "*") 100 defaults = { 101 forward_variables_from(_toolchain_base.defaults, "*") 102 forward_variables_from(_target_config, "*") 103 default_configs += _target_default_configs 104 } 105 } 106 } 107 108 # This list just contains the members of the above scope for convenience to make 109 # it trivial to generate all the toolchains in this file via a 110 # `pw_generate_android_toolchains` target. 111 pw_target_toolchain_android_list = [ 112 pw_target_toolchain_android.debug, 113 pw_target_toolchain_android.speed_optimized, 114 pw_target_toolchain_android.size_optimized, 115 ] 116} 117