Colin Cross | 1d3ac56 | 2016-12-07 14:21:42 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2014 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
Bob Badour | 8735385 | 2021-02-12 17:59:41 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["frameworks_compile_libbcc_license"], |
| 19 | } |
| 20 | |
| 21 | // Added automatically by a large-scale-change that took the approach of |
| 22 | // 'apply every license found to every target'. While this makes sure we respect |
| 23 | // every license restriction, it may not be entirely correct. |
| 24 | // |
| 25 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 26 | // |
| 27 | // Please consider splitting the single license below into multiple licenses, |
| 28 | // taking care not to lose any license_kind information, and overriding the |
| 29 | // default license using the 'licenses: [...]' property on targets as needed. |
| 30 | // |
| 31 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 32 | // to attach the license to, and including a comment whether the files may be |
| 33 | // used in the current project. |
| 34 | // See: http://go/android-license-faq |
| 35 | license { |
| 36 | name: "frameworks_compile_libbcc_license", |
| 37 | visibility: [":__subpackages__"], |
| 38 | license_kinds: [ |
| 39 | "SPDX-license-identifier-Apache-2.0", |
| 40 | "SPDX-license-identifier-BSD", |
| 41 | "SPDX-license-identifier-MIT", |
| 42 | "SPDX-license-identifier-NCSA", |
| 43 | "legacy_unencumbered", |
| 44 | ], |
| 45 | license_text: [ |
| 46 | "NOTICE", |
| 47 | ], |
| 48 | } |
| 49 | |
Colin Cross | 1d3ac56 | 2016-12-07 14:21:42 -0800 | [diff] [blame] | 50 | cc_defaults { |
| 51 | name: "libbcc-defaults", |
| 52 | defaults: [ |
| 53 | "llvm-defaults", |
Colin Cross | 1d3ac56 | 2016-12-07 14:21:42 -0800 | [diff] [blame] | 54 | "rs-version", |
| 55 | "libbcc-targets", |
| 56 | ], |
| 57 | |
Colin Cross | 1d3ac56 | 2016-12-07 14:21:42 -0800 | [diff] [blame] | 58 | cflags: [ |
| 59 | "-Wall", |
| 60 | "-Wno-unused-parameter", |
| 61 | "-Werror", |
| 62 | "-D__DISABLE_ASSERTS", |
| 63 | ], |
| 64 | |
| 65 | target: { |
| 66 | android: { |
| 67 | cflags: [ |
| 68 | "-DTARGET_BUILD", |
| 69 | ], |
| 70 | }, |
| 71 | host: { |
| 72 | compile_multilib: "first", |
| 73 | cflags: [ |
| 74 | "-D__HOST__", |
| 75 | ], |
| 76 | }, |
| 77 | }, |
| 78 | |
| 79 | product_variables: { |
| 80 | eng: { |
| 81 | cflags: ["-U__DISABLE_ASSERTS"], |
| 82 | }, |
| 83 | }, |
| 84 | |
| 85 | include_dirs: [ |
| 86 | "frameworks/compile/libbcc/include", |
| 87 | "frameworks/rs", |
| 88 | ], |
| 89 | } |
| 90 | |
| 91 | //===================================================================== |
| 92 | // Architecture Selection |
| 93 | //===================================================================== |
| 94 | // Note: We should only use -DFORCE_ARCH_CODEGEN on target build. |
| 95 | // For the host build, we will include as many architecture as possible, |
| 96 | // so that we can test the execution engine easily. |
| 97 | |
| 98 | cc_defaults { |
| 99 | name: "libbcc-targets", |
| 100 | arch: { |
| 101 | arm: { |
| 102 | cflags: [ |
| 103 | "-DFORCE_ARM_CODEGEN", |
| 104 | "-DARCH_ARM_HAVE_VFP", |
Miao Wang | eb671b1 | 2020-01-29 17:36:01 -0800 | [diff] [blame] | 105 | "-DPROVIDE_ARM64_CODEGEN", |
Colin Cross | 1d3ac56 | 2016-12-07 14:21:42 -0800 | [diff] [blame] | 106 | ], |
Isaac Chen | 3a8667f | 2017-09-12 16:55:41 +0800 | [diff] [blame] | 107 | neon: { |
Colin Cross | 1d3ac56 | 2016-12-07 14:21:42 -0800 | [diff] [blame] | 108 | cflags: [ |
| 109 | "-DARCH_ARM_HAVE_VFP_D32", |
| 110 | "-DARCH_ARM_HAVE_NEON", |
| 111 | ], |
| 112 | }, |
| 113 | }, |
| 114 | arm64: { |
| 115 | cflags: [ |
| 116 | "-DFORCE_ARM64_CODEGEN", |
| 117 | "-DARCH_ARM_HAVE_NEON", |
| 118 | "-DARCH_ARM_HAVE_VFP", |
| 119 | "-DARCH_ARM_HAVE_VFP_D32", |
| 120 | "-DDISABLE_CLCORE_NEON", |
| 121 | ], |
| 122 | }, |
Colin Cross | 1d3ac56 | 2016-12-07 14:21:42 -0800 | [diff] [blame] | 123 | }, |
| 124 | target: { |
| 125 | android_x86: { |
| 126 | cflags: ["-DFORCE_X86_CODEGEN"], |
| 127 | }, |
| 128 | android_x86_64: { |
| 129 | cflags: ["-DFORCE_X86_64_CODEGEN"], |
| 130 | }, |
| 131 | arm_on_x86: { |
| 132 | cflags: [ |
| 133 | "-DPROVIDE_ARM_CODEGEN", |
| 134 | "-DFORCE_BUILD_ARM", |
| 135 | ], |
| 136 | }, |
| 137 | arm_on_x86_64: { |
| 138 | cflags: [ |
| 139 | "-DPROVIDE_ARM_CODEGEN", |
| 140 | "-DFORCE_BUILD_ARM", |
| 141 | "-DPROVIDE_ARM64_CODEGEN", |
| 142 | ], |
| 143 | }, |
| 144 | }, |
| 145 | } |
| 146 | |
Colin Cross | 1d3ac56 | 2016-12-07 14:21:42 -0800 | [diff] [blame] | 147 | subdirs = [ |
| 148 | "bcinfo", |
| 149 | "lib", |
| 150 | "tools", |
| 151 | ] |