Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [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 | |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 17 | // This produces human-readable asm_defines.s with the embedded compile-time constants. |
Bob Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 18 | package { |
| 19 | // See: http://go/android-license-faq |
| 20 | // A large-scale-change added 'default_applicable_licenses' to import |
| 21 | // all of the 'license_kinds' from "art_license" |
| 22 | // to get the below license kinds: |
| 23 | // SPDX-license-identifier-Apache-2.0 |
| 24 | default_applicable_licenses: ["art_license"], |
| 25 | } |
| 26 | |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 27 | cc_object { |
| 28 | name: "asm_defines.s", |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 29 | host_supported: true, |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 30 | device_supported: true, |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 31 | defaults: [ |
| 32 | "art_debug_defaults", |
| 33 | "art_defaults", |
| 34 | ], |
Paul Duffin | eafeeb2 | 2019-07-19 10:22:32 +0100 | [diff] [blame] | 35 | header_libs: [ |
| 36 | "art_libartbase_headers", // For base/bit_utils.h |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 37 | "jni_headers", |
Paul Duffin | eafeeb2 | 2019-07-19 10:22:32 +0100 | [diff] [blame] | 38 | "libart_runtime_headers_ndk", |
| 39 | "libdexfile_all_headers", // For dex/modifiers.h |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 40 | ], |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 41 | // Produce text file rather than binary. |
| 42 | cflags: ["-S"], |
| 43 | srcs: ["asm_defines.cc"], |
Jiyong Park | 7c2f69e | 2020-01-15 15:43:32 +0900 | [diff] [blame] | 44 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 45 | "com.android.art", |
Jiyong Park | 7c2f69e | 2020-01-15 15:43:32 +0900 | [diff] [blame] | 46 | "com.android.art.debug", |
Jiyong Park | 7c2f69e | 2020-01-15 15:43:32 +0900 | [diff] [blame] | 47 | ], |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 48 | } |
Igor Murashkin | 2bb70d3 | 2017-02-06 10:34:14 -0800 | [diff] [blame] | 49 | |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 50 | soong_config_module_type_import { |
| 51 | from: "art/build/SoongConfig.bp", |
| 52 | module_types: [ |
| 53 | "art_module_cc_genrule", |
| 54 | ], |
| 55 | } |
| 56 | |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 57 | // This extracts the compile-time constants from asm_defines.s and creates the header. |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 58 | art_module_cc_genrule { |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 59 | name: "cpp-define-generator-asm-support", |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 60 | |
| 61 | // :asm_defines.s is only available when building ART from source, so do the |
| 62 | // same here. |
| 63 | // TODO(b/172480617): Clean up when sources are gone from the platform tree |
| 64 | // and we no longer need to support sources present when prebuilts are used. |
| 65 | enabled: false, |
| 66 | soong_config_variables: { |
| 67 | source_build: { |
| 68 | enabled: true, |
| 69 | }, |
| 70 | }, |
| 71 | |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 72 | host_supported: true, |
| 73 | device_supported: true, |
| 74 | srcs: [":asm_defines.s"], |
David Srbecky | 766e74f | 2018-10-02 17:12:24 +0100 | [diff] [blame] | 75 | out: ["asm_defines.h"], |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 76 | tool_files: ["make_header.py"], |
| 77 | cmd: "$(location make_header.py) \"$(in)\" > \"$(out)\"", |
Elliott Hughes | 221dfa6 | 2019-09-03 16:03:56 -0700 | [diff] [blame] | 78 | target: { |
| 79 | darwin: { |
| 80 | enabled: false, |
| 81 | }, |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 82 | windows: { |
| 83 | // When the module is enabled globally in the soong_config_variables |
| 84 | // stanza above, it gets enabled on windows too. Hence we need to |
| 85 | // disable it explicitly. |
| 86 | // TODO(b/172480617): Clean up with that. |
| 87 | enabled: false, |
| 88 | }, |
Elliott Hughes | 221dfa6 | 2019-09-03 16:03:56 -0700 | [diff] [blame] | 89 | }, |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 90 | |
| 91 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 92 | "com.android.art", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 93 | "com.android.art.debug", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 94 | ], |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | cc_library_headers { |
| 98 | name: "cpp-define-generator-definitions", |
| 99 | host_supported: true, |
| 100 | export_include_dirs: ["."], |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 101 | |
| 102 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 103 | "com.android.art", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 104 | "com.android.art.debug", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 105 | ], |
Nicolas Geoffray | ec388c0 | 2021-03-03 22:09:06 +0000 | [diff] [blame] | 106 | min_sdk_version: "S", |
David Srbecky | 0adf4d8 | 2018-10-01 18:17:45 +0100 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | python_binary_host { |
| 110 | name: "cpp-define-generator-test", |
| 111 | main: "make_header_test.py", |
| 112 | srcs: [ |
| 113 | "make_header.py", |
| 114 | "make_header_test.py", |
| 115 | ], |
| 116 | test_suites: ["general-tests"], |
Igor Murashkin | 2bb70d3 | 2017-02-06 10:34:14 -0800 | [diff] [blame] | 117 | } |