Bob Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 1 | package { |
| 2 | // See: http://go/android-license-faq |
| 3 | // A large-scale-change added 'default_applicable_licenses' to import |
| 4 | // all of the 'license_kinds' from "art_license" |
| 5 | // to get the below license kinds: |
| 6 | // SPDX-license-identifier-Apache-2.0 |
| 7 | default_applicable_licenses: ["art_license"], |
| 8 | } |
| 9 | |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 10 | bootstrap_go_package { |
| 11 | name: "soong-art", |
| 12 | pkgPath: "android/soong/art", |
| 13 | deps: [ |
| 14 | "blueprint", |
| 15 | "blueprint-pathtools", |
Colin Cross | 84b6933 | 2017-11-01 14:23:17 -0700 | [diff] [blame] | 16 | "blueprint-proptools", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 17 | "soong", |
| 18 | "soong-android", |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 19 | "soong-apex", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 20 | "soong-cc", |
| 21 | ], |
| 22 | srcs: [ |
| 23 | "art.go", |
| 24 | "codegen.go", |
| 25 | "makevars.go", |
| 26 | ], |
| 27 | pluginFor: ["soong_build"], |
| 28 | } |
| 29 | |
Andreas Gampe | 896583e | 2018-06-15 13:31:58 -0700 | [diff] [blame] | 30 | art_clang_tidy_errors = [ |
Andreas Gampe | dfcd82c | 2018-10-16 20:22:37 -0700 | [diff] [blame] | 31 | "android-cloexec-dup", |
| 32 | "android-cloexec-open", |
Andreas Gampe | 6cd8390 | 2018-10-03 20:03:03 -0700 | [diff] [blame] | 33 | "bugprone-argument-comment", |
Andreas Gampe | 322c089 | 2018-09-18 13:50:29 -0700 | [diff] [blame] | 34 | "bugprone-lambda-function-name", |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 35 | "bugprone-unused-raii", // Protect scoped things like MutexLock. |
Andreas Gampe | afaf7f8 | 2018-10-16 11:32:38 -0700 | [diff] [blame] | 36 | "bugprone-unused-return-value", |
Andreas Gampe | 322c089 | 2018-09-18 13:50:29 -0700 | [diff] [blame] | 37 | "bugprone-virtual-near-miss", |
Andreas Gampe | 8351aac | 2018-09-10 12:37:49 -0700 | [diff] [blame] | 38 | "modernize-use-bool-literals", |
Andreas Gampe | 322c089 | 2018-09-18 13:50:29 -0700 | [diff] [blame] | 39 | "modernize-use-nullptr", |
Andreas Gampe | c55bb39 | 2018-09-21 00:02:02 +0000 | [diff] [blame] | 40 | "modernize-use-using", |
Andreas Gampe | 322c089 | 2018-09-18 13:50:29 -0700 | [diff] [blame] | 41 | "performance-faster-string-find", |
Andreas Gampe | 6f4cf6e | 2018-06-19 17:10:48 -0700 | [diff] [blame] | 42 | "performance-for-range-copy", |
Andreas Gampe | 322c089 | 2018-09-18 13:50:29 -0700 | [diff] [blame] | 43 | "performance-implicit-conversion-in-loop", |
Andreas Gampe | 44b3174 | 2018-10-01 19:30:57 -0700 | [diff] [blame] | 44 | "performance-noexcept-move-constructor", |
Andreas Gampe | 6f4cf6e | 2018-06-19 17:10:48 -0700 | [diff] [blame] | 45 | "performance-unnecessary-copy-initialization", |
| 46 | "performance-unnecessary-value-param", |
Andreas Gampe | bd39d14 | 2018-07-19 11:14:42 -0700 | [diff] [blame] | 47 | "misc-unused-using-decls", |
Andreas Gampe | 896583e | 2018-06-15 13:31:58 -0700 | [diff] [blame] | 48 | ] |
Andreas Gampe | 896583e | 2018-06-15 13:31:58 -0700 | [diff] [blame] | 49 | |
| 50 | art_clang_tidy_disabled = [ |
| 51 | "-google-default-arguments", |
| 52 | // We have local stores that are only used for debug checks. |
| 53 | "-clang-analyzer-deadcode.DeadStores", |
| 54 | // We are OK with some static globals and that they can, in theory, throw. |
| 55 | "-cert-err58-cpp", |
| 56 | // We have lots of C-style variadic functions, and are OK with them. JNI ensures |
| 57 | // that working around this warning would be extra-painful. |
| 58 | "-cert-dcl50-cpp", |
Andreas Gampe | 322c089 | 2018-09-18 13:50:29 -0700 | [diff] [blame] | 59 | // "Modernization" we don't agree with. |
| 60 | "-modernize-use-auto", |
| 61 | "-modernize-return-braced-init-list", |
| 62 | "-modernize-use-default-member-init", |
| 63 | "-modernize-pass-by-value", |
Andreas Gampe | 896583e | 2018-06-15 13:31:58 -0700 | [diff] [blame] | 64 | ] |
| 65 | |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 66 | soong_config_module_type_import { |
| 67 | from: "art/build/SoongConfig.bp", |
| 68 | module_types: [ |
| 69 | "art_module_art_global_defaults", |
| 70 | "art_module_cc_defaults", |
| 71 | "art_module_java_defaults", |
Martin Stjernholm | 41e56c2 | 2021-10-14 00:28:12 +0100 | [diff] [blame] | 72 | "art_module_genrule_defaults", |
| 73 | "art_module_prebuilt_defaults", |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 74 | ], |
| 75 | } |
| 76 | |
| 77 | art_module_art_global_defaults { |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 78 | // Additional flags are computed by art.go |
| 79 | |
| 80 | name: "art_defaults", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 81 | |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 82 | // Disable all ART Soong modules by default when ART prebuilts are in use. |
| 83 | // TODO(b/172480617): Clean up when sources are gone from the platform tree |
| 84 | // and we no longer need to support sources present when prebuilts are used. |
| 85 | enabled: false, |
| 86 | soong_config_variables: { |
| 87 | source_build: { |
| 88 | enabled: true, |
| 89 | }, |
| 90 | }, |
| 91 | |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 92 | // This is the default visibility for the //art package, but we repeat it |
| 93 | // here so that it gets merged with other visibility rules in modules |
| 94 | // extending these defaults. |
| 95 | visibility: ["//art:__subpackages__"], |
| 96 | |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 97 | cflags: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 98 | // Base set of cflags used by all things ART. |
| 99 | "-fno-rtti", |
| 100 | "-ggdb3", |
| 101 | "-Wall", |
| 102 | "-Werror", |
| 103 | "-Wextra", |
| 104 | "-Wstrict-aliasing", |
| 105 | "-fstrict-aliasing", |
| 106 | "-Wunreachable-code", |
| 107 | "-Wredundant-decls", |
| 108 | "-Wshadow", |
| 109 | "-Wunused", |
| 110 | "-fvisibility=protected", |
| 111 | |
| 112 | // Warn about thread safety violations with clang. |
| 113 | "-Wthread-safety", |
Colin Cross | 62f62f3 | 2019-11-05 15:55:45 -0800 | [diff] [blame] | 114 | // TODO(b/144045034): turn on -Wthread-safety-negative |
| 115 | //"-Wthread-safety-negative", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 116 | |
| 117 | // Warn if switch fallthroughs aren't annotated. |
| 118 | "-Wimplicit-fallthrough", |
| 119 | |
| 120 | // Enable float equality warnings. |
| 121 | "-Wfloat-equal", |
| 122 | |
| 123 | // Enable warning of converting ints to void*. |
| 124 | "-Wint-to-void-pointer-cast", |
| 125 | |
| 126 | // Enable warning of wrong unused annotations. |
| 127 | "-Wused-but-marked-unused", |
| 128 | |
| 129 | // Enable warning for deprecated language features. |
| 130 | "-Wdeprecated", |
| 131 | |
| 132 | // Enable warning for unreachable break & return. |
| 133 | "-Wunreachable-code-break", |
| 134 | "-Wunreachable-code-return", |
| 135 | |
David Srbecky | 56de89a | 2018-10-01 15:32:20 +0100 | [diff] [blame] | 136 | // Disable warning for use of offsetof on non-standard layout type. |
| 137 | // We use it to implement OFFSETOF_MEMBER - see macros.h. |
| 138 | "-Wno-invalid-offsetof", |
| 139 | |
Yi Kong | 3940254 | 2019-03-24 02:47:16 -0700 | [diff] [blame] | 140 | // Enable inconsistent-missing-override warning. This warning is disabled by default in |
| 141 | // Android. |
| 142 | "-Winconsistent-missing-override", |
| 143 | |
David Sehr | ae3bcac | 2017-02-03 15:19:00 -0800 | [diff] [blame] | 144 | // Enable thread annotations for std::mutex, etc. |
| 145 | "-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 146 | ], |
| 147 | |
jaishank | bf7ce25 | 2019-06-10 16:16:47 +0530 | [diff] [blame] | 148 | arch: { |
| 149 | x86: { |
| 150 | avx2: { |
| 151 | cflags: [ |
| 152 | "-mavx2", |
| 153 | "-mfma", |
| 154 | ], |
| 155 | }, |
| 156 | }, |
| 157 | x86_64: { |
| 158 | avx2: { |
| 159 | cflags: [ |
| 160 | "-mavx2", |
| 161 | "-mfma", |
| 162 | ], |
| 163 | }, |
| 164 | }, |
| 165 | }, |
| 166 | |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 167 | target: { |
| 168 | android: { |
| 169 | cflags: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 170 | // To use oprofile_android --callgraph, uncomment this and recompile with |
| 171 | // mmma -j art |
| 172 | // "-fno-omit-frame-pointer", |
| 173 | // "-marm", |
| 174 | // "-mapcs", |
| 175 | ], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 176 | }, |
Dan Willemsen | 057f1e4 | 2017-10-03 14:11:48 -0700 | [diff] [blame] | 177 | linux: { |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 178 | cflags: [ |
| 179 | // Enable missing-noreturn only on non-Mac. As lots of things are not implemented for |
| 180 | // Apple, it's a pain. |
| 181 | "-Wmissing-noreturn", |
| 182 | ], |
| 183 | }, |
Andreas Gampe | a47a6e8 | 2019-07-24 09:46:16 -0700 | [diff] [blame] | 184 | linux_bionic: { |
Calin Juravle | 542e393 | 2019-12-09 19:54:18 -0800 | [diff] [blame] | 185 | strip: { |
Calin Juravle | 3bdb977 | 2019-12-10 11:31:53 -0800 | [diff] [blame] | 186 | // Do not strip art libs when building for linux-bionic. |
| 187 | // Otherwise we can't get any symbols out of crashes. |
Calin Juravle | 542e393 | 2019-12-09 19:54:18 -0800 | [diff] [blame] | 188 | none: true, |
| 189 | }, |
Andreas Gampe | a47a6e8 | 2019-07-24 09:46:16 -0700 | [diff] [blame] | 190 | }, |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 191 | darwin: { |
| 192 | enabled: false, |
| 193 | }, |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 194 | windows: { |
| 195 | // When the module is enabled globally in the soong_config_variables |
| 196 | // stanza above, it may get enabled on windows too for some module |
| 197 | // types. Hence we need to disable it explicitly. |
| 198 | // TODO(b/172480617): Clean up with that. |
| 199 | enabled: false, |
| 200 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 201 | host: { |
| 202 | cflags: [ |
| 203 | // Bug: 15446488. We don't omit the frame pointer to work around |
| 204 | // clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress. |
| 205 | "-fno-omit-frame-pointer", |
Yi Kong | 57c6a72 | 2021-09-23 16:17:12 +0800 | [diff] [blame] | 206 | ], |
| 207 | }, |
| 208 | // The build assumes that all our x86/x86_64 hosts (such as buildbots and developer |
| 209 | // desktops) support at least sse4.2/popcount. This firstly implies that the ART |
| 210 | // runtime binary itself may exploit these features. Secondly, this implies that |
| 211 | // the ART runtime passes these feature flags to dex2oat and JIT by calling the |
| 212 | // method InstructionSetFeatures::FromCppDefines(). Since invoking dex2oat directly |
| 213 | // does not pick up these flags, cross-compiling from a x86/x86_64 host to a |
| 214 | // x86/x86_64 target should not be affected. |
| 215 | linux_x86: { |
| 216 | cflags: [ |
| 217 | "-msse4.2", |
| 218 | "-mpopcnt", |
| 219 | ], |
| 220 | }, |
| 221 | linux_x86_64: { |
| 222 | cflags: [ |
Aart Bik | f605257 | 2017-07-20 16:47:45 -0700 | [diff] [blame] | 223 | "-msse4.2", |
| 224 | "-mpopcnt", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 225 | ], |
| 226 | }, |
| 227 | }, |
| 228 | |
| 229 | codegen: { |
| 230 | arm: { |
| 231 | cflags: ["-DART_ENABLE_CODEGEN_arm"], |
| 232 | }, |
| 233 | arm64: { |
| 234 | cflags: ["-DART_ENABLE_CODEGEN_arm64"], |
| 235 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 236 | x86: { |
| 237 | cflags: ["-DART_ENABLE_CODEGEN_x86"], |
| 238 | }, |
| 239 | x86_64: { |
| 240 | cflags: ["-DART_ENABLE_CODEGEN_x86_64"], |
| 241 | }, |
| 242 | }, |
| 243 | |
Andreas Gampe | 896583e | 2018-06-15 13:31:58 -0700 | [diff] [blame] | 244 | tidy_checks: art_clang_tidy_errors + art_clang_tidy_disabled, |
Nikita Ioffe | 0841735 | 2019-03-28 12:47:38 +0000 | [diff] [blame] | 245 | tidy_checks_as_errors: art_clang_tidy_errors, |
George Burgess IV | 7fb4665 | 2017-06-16 15:35:33 -0700 | [diff] [blame] | 246 | |
| 247 | tidy_flags: [ |
| 248 | // The static analyzer treats DCHECK as always enabled; we sometimes get |
| 249 | // false positives when we use DCHECKs with code that relies on NDEBUG. |
| 250 | "-extra-arg=-UNDEBUG", |
George Burgess IV | dd8aa32 | 2017-06-21 16:34:35 -0700 | [diff] [blame] | 251 | // clang-tidy complains about functions like: |
| 252 | // void foo() { CHECK(kIsFooEnabled); /* do foo... */ } |
| 253 | // not being marked noreturn if kIsFooEnabled is false. |
| 254 | "-extra-arg=-Wno-missing-noreturn", |
Andreas Gampe | 020020f | 2018-07-10 12:34:23 -0700 | [diff] [blame] | 255 | // Because tidy doesn't like our flow checks for compile-time configuration and thinks that |
| 256 | // the following code is dead (it is, but not for all configurations), disable unreachable |
| 257 | // code detection in Clang for tidy builds. It is still on for regular build steps, so we |
| 258 | // will still get the "real" errors. |
| 259 | "-extra-arg=-Wno-unreachable-code", |
George Burgess IV | 7fb4665 | 2017-06-16 15:35:33 -0700 | [diff] [blame] | 260 | ], |
Nicolas Geoffray | ec388c0 | 2021-03-03 22:09:06 +0000 | [diff] [blame] | 261 | |
Martin Stjernholm | f726d20 | 2021-10-28 03:52:25 +0100 | [diff] [blame^] | 262 | min_sdk_version: "31", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 263 | } |
| 264 | |
Collin Fijalkovich | 07ff283 | 2020-08-25 10:43:12 -0700 | [diff] [blame] | 265 | // Used to generate binaries that can be backed by transparent hugepages. |
| 266 | cc_defaults { |
| 267 | name: "art_hugepage_defaults", |
| 268 | arch: { |
| 269 | arm64: { |
| 270 | ldflags: ["-z max-page-size=0x200000"], |
| 271 | }, |
| 272 | x86_64: { |
| 273 | ldflags: ["-z max-page-size=0x200000"], |
| 274 | }, |
| 275 | }, |
| 276 | } |
| 277 | |
Yi Kong | f579b06 | 2020-10-24 22:54:39 +0800 | [diff] [blame] | 278 | cc_defaults { |
| 279 | name: "art_pgo_defaults", |
| 280 | visibility: ["//art:__subpackages__"], |
| 281 | pgo: { |
| 282 | sampling: true, |
| 283 | }, |
| 284 | target: { |
| 285 | android_arm64: { |
| 286 | pgo: { |
| 287 | profile_file: "art/art_arm_arm64.profdata", |
| 288 | }, |
| 289 | }, |
| 290 | android_arm: { |
| 291 | pgo: { |
| 292 | profile_file: "art/art_arm_arm64.profdata", |
| 293 | }, |
| 294 | }, |
| 295 | android_x86_64: { |
| 296 | pgo: { |
| 297 | profile_file: "art/art_x86_x86_64.profdata", |
| 298 | }, |
| 299 | }, |
| 300 | android_x86: { |
| 301 | pgo: { |
| 302 | profile_file: "art/art_x86_x86_64.profdata", |
| 303 | }, |
| 304 | }, |
| 305 | }, |
| 306 | } |
| 307 | |
Colin Cross | be332ed | 2016-09-21 13:23:53 -0700 | [diff] [blame] | 308 | art_debug_defaults { |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 309 | name: "art_debug_defaults", |
Martin Stjernholm | 9dca919 | 2021-10-28 03:01:13 +0100 | [diff] [blame] | 310 | defaults: ["art_defaults"], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 311 | visibility: ["//art:__subpackages__"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 312 | cflags: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 313 | "-DDYNAMIC_ANNOTATIONS_ENABLED=1", |
| 314 | "-DVIXL_DEBUG", |
| 315 | "-UNDEBUG", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 316 | ], |
| 317 | asflags: [ |
| 318 | "-UNDEBUG", |
| 319 | ], |
Colin Cross | c564406 | 2016-08-30 15:41:08 -0700 | [diff] [blame] | 320 | target: { |
| 321 | // This has to be duplicated for android and host to make sure it |
| 322 | // comes after the -Wframe-larger-than warnings inserted by art.go |
| 323 | // target-specific properties |
| 324 | android: { |
| 325 | cflags: ["-Wno-frame-larger-than="], |
| 326 | }, |
| 327 | host: { |
| 328 | cflags: ["-Wno-frame-larger-than="], |
| 329 | }, |
| 330 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 331 | } |
Nicolas Geoffray | f6c3784 | 2020-03-31 14:00:47 +0100 | [diff] [blame] | 332 | |
| 333 | // A version of conscrypt only for enabling the "-hostdex" version to test ART on host. |
| 334 | java_library { |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 335 | // We need our own name to not clash with the conscrypt library. |
Nicolas Geoffray | f6c3784 | 2020-03-31 14:00:47 +0100 | [diff] [blame] | 336 | name: "conscrypt-host", |
| 337 | installable: true, |
| 338 | hostdex: true, |
Paul Duffin | b283f37 | 2021-04-19 18:08:23 +0100 | [diff] [blame] | 339 | static_libs: ["conscrypt-for-host"], |
Nicolas Geoffray | f6c3784 | 2020-03-31 14:00:47 +0100 | [diff] [blame] | 340 | |
| 341 | // Tests and build files rely on this file to be installed as "conscrypt-hostdex", |
| 342 | // therefore set a stem. Without it, the file would be installed as |
| 343 | // "conscrypt-host-hostdex". |
| 344 | stem: "conscrypt", |
| 345 | sdk_version: "core_platform", |
| 346 | target: { |
| 347 | hostdex: { |
| 348 | required: ["libjavacrypto"], |
| 349 | }, |
Yo Chiang | e492f7e | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 350 | darwin: { |
| 351 | // required module "libjavacrypto" is disabled on darwin |
| 352 | enabled: false, |
| 353 | }, |
Nicolas Geoffray | f6c3784 | 2020-03-31 14:00:47 +0100 | [diff] [blame] | 354 | }, |
| 355 | } |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 356 | |
| 357 | // A version of core-icu4j only for enabling the "-hostdex" version to test ART on host. |
| 358 | java_library { |
| 359 | // We need our own name to not clash with the core-icu4j library. |
| 360 | name: "core-icu4j-host", |
| 361 | installable: true, |
| 362 | hostdex: true, |
Paul Duffin | 7957811 | 2021-04-20 11:36:08 +0100 | [diff] [blame] | 363 | static_libs: ["core-icu4j-for-host"], |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 364 | |
| 365 | // Tests and build files rely on this file to be installed as "core-icu4j-hostdex", |
| 366 | // therefore set a stem. Without it, the file would be installed as |
| 367 | // "core-icu4j-host-hostdex". |
| 368 | stem: "core-icu4j", |
| 369 | sdk_version: "core_platform", |
| 370 | target: { |
| 371 | hostdex: { |
| 372 | required: ["libicu_jni"], |
| 373 | }, |
| 374 | }, |
| 375 | } |
Martin Stjernholm | 41e56c2 | 2021-10-14 00:28:12 +0100 | [diff] [blame] | 376 | |
| 377 | // Defaults for different module types to enable them only when building ART |
| 378 | // from sources. TODO(b/172480617): Clean up when sources are gone from the |
| 379 | // platform tree and we no longer need to support sources present when prebuilts |
| 380 | // are used. |
| 381 | art_module_cc_defaults { |
| 382 | name: "art_module_source_build_defaults", |
| 383 | defaults_visibility: [ |
| 384 | "//art:__subpackages__", |
| 385 | "//libcore:__subpackages__", |
| 386 | "//libnativehelper:__subpackages__", |
| 387 | ], |
| 388 | enabled: false, |
| 389 | soong_config_variables: { |
| 390 | source_build: { |
| 391 | enabled: true, |
| 392 | }, |
| 393 | }, |
| 394 | target: { |
| 395 | windows: { |
| 396 | // Windows is disabled by default, but if we set enabled:true |
| 397 | // globally above we need to disable it explicitly. |
| 398 | enabled: false, |
| 399 | }, |
| 400 | }, |
| 401 | } |
| 402 | art_module_java_defaults { |
| 403 | name: "art_module_source_build_java_defaults", |
| 404 | defaults_visibility: [ |
| 405 | "//art:__subpackages__", |
| 406 | "//libcore:__subpackages__", |
| 407 | "//libnativehelper:__subpackages__", |
| 408 | ], |
| 409 | enabled: false, |
| 410 | soong_config_variables: { |
| 411 | source_build: { |
| 412 | enabled: true, |
| 413 | }, |
| 414 | }, |
| 415 | target: { |
| 416 | windows: { |
| 417 | enabled: false, |
| 418 | }, |
| 419 | }, |
| 420 | } |
| 421 | art_module_genrule_defaults { |
| 422 | name: "art_module_source_build_genrule_defaults", |
| 423 | defaults_visibility: [ |
| 424 | "//art:__subpackages__", |
| 425 | "//libcore:__subpackages__", |
| 426 | "//libnativehelper:__subpackages__", |
| 427 | ], |
| 428 | enabled: false, |
| 429 | soong_config_variables: { |
| 430 | source_build: { |
| 431 | enabled: true, |
| 432 | }, |
| 433 | }, |
| 434 | target: { |
| 435 | windows: { |
| 436 | enabled: false, |
| 437 | }, |
| 438 | }, |
| 439 | } |
| 440 | art_module_prebuilt_defaults { |
| 441 | name: "art_module_source_build_prebuilt_defaults", |
| 442 | defaults_visibility: [ |
| 443 | "//art:__subpackages__", |
| 444 | "//libcore:__subpackages__", |
| 445 | "//libnativehelper:__subpackages__", |
| 446 | ], |
| 447 | enabled: false, |
| 448 | soong_config_variables: { |
| 449 | source_build: { |
| 450 | enabled: true, |
| 451 | }, |
| 452 | }, |
| 453 | target: { |
| 454 | windows: { |
| 455 | enabled: false, |
| 456 | }, |
| 457 | }, |
| 458 | } |