blob: a436430c1620a0fb173be264a1102797741af034 [file] [log] [blame]
Colin Crossfe6064a2016-08-30 13:49:26 -07001//
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 Srbecky0adf4d82018-10-01 18:17:45 +010017// This produces human-readable asm_defines.s with the embedded compile-time constants.
Bob Badour9150de62021-02-26 03:22:24 -080018package {
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 Srbecky0adf4d82018-10-01 18:17:45 +010027cc_object {
28 name: "asm_defines.s",
Colin Crossfe6064a2016-08-30 13:49:26 -070029 host_supported: true,
David Srbecky0adf4d82018-10-01 18:17:45 +010030 device_supported: true,
Colin Crossfe6064a2016-08-30 13:49:26 -070031 defaults: [
32 "art_debug_defaults",
33 "art_defaults",
34 ],
Paul Duffineafeeb22019-07-19 10:22:32 +010035 header_libs: [
36 "art_libartbase_headers", // For base/bit_utils.h
Orion Hodson00cb81d2020-04-03 06:47:07 +010037 "jni_headers",
Paul Duffineafeeb22019-07-19 10:22:32 +010038 "libart_runtime_headers_ndk",
39 "libdexfile_all_headers", // For dex/modifiers.h
David Sehr334b9d72018-02-12 18:27:56 -080040 ],
Martin Stjernholmcfea6672020-07-16 03:36:43 +010041 target: {
42 android: {
43 header_libs: ["libc_headers"], // TODO(b/153662223): Clean this up.
44 },
45 linux_bionic: {
46 header_libs: ["libc_headers"], // TODO(b/153662223): Clean this up.
47 },
48 },
David Srbecky0adf4d82018-10-01 18:17:45 +010049 // Produce text file rather than binary.
50 cflags: ["-S"],
51 srcs: ["asm_defines.cc"],
Jiyong Park7c2f69e2020-01-15 15:43:32 +090052 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010053 "com.android.art",
Jiyong Park7c2f69e2020-01-15 15:43:32 +090054 "com.android.art.debug",
Jiyong Park7c2f69e2020-01-15 15:43:32 +090055 ],
Colin Crossfe6064a2016-08-30 13:49:26 -070056}
Igor Murashkin2bb70d32017-02-06 10:34:14 -080057
Martin Stjernholm6eb17832021-05-10 17:44:05 +010058soong_config_module_type_import {
59 from: "art/build/SoongConfig.bp",
60 module_types: [
61 "art_module_cc_genrule",
62 ],
63}
64
David Srbecky0adf4d82018-10-01 18:17:45 +010065// This extracts the compile-time constants from asm_defines.s and creates the header.
Martin Stjernholm6eb17832021-05-10 17:44:05 +010066art_module_cc_genrule {
Dan Willemsen2ca27802017-09-27 14:57:43 -070067 name: "cpp-define-generator-asm-support",
Martin Stjernholm6eb17832021-05-10 17:44:05 +010068
69 // :asm_defines.s is only available when building ART from source, so do the
70 // same here.
71 // TODO(b/172480617): Clean up when sources are gone from the platform tree
72 // and we no longer need to support sources present when prebuilts are used.
73 enabled: false,
74 soong_config_variables: {
75 source_build: {
76 enabled: true,
77 },
78 },
79
David Srbecky0adf4d82018-10-01 18:17:45 +010080 host_supported: true,
81 device_supported: true,
82 srcs: [":asm_defines.s"],
David Srbecky766e74f2018-10-02 17:12:24 +010083 out: ["asm_defines.h"],
David Srbecky0adf4d82018-10-01 18:17:45 +010084 tool_files: ["make_header.py"],
85 cmd: "$(location make_header.py) \"$(in)\" > \"$(out)\"",
Elliott Hughes221dfa62019-09-03 16:03:56 -070086 target: {
87 darwin: {
88 enabled: false,
89 },
Martin Stjernholm6eb17832021-05-10 17:44:05 +010090 windows: {
91 // When the module is enabled globally in the soong_config_variables
92 // stanza above, it gets enabled on windows too. Hence we need to
93 // disable it explicitly.
94 // TODO(b/172480617): Clean up with that.
95 enabled: false,
96 },
Elliott Hughes221dfa62019-09-03 16:03:56 -070097 },
Jiyong Park71f661c2020-04-28 18:20:43 +090098
99 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100100 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900101 "com.android.art.debug",
Jiyong Park71f661c2020-04-28 18:20:43 +0900102 ],
David Srbecky0adf4d82018-10-01 18:17:45 +0100103}
104
105cc_library_headers {
106 name: "cpp-define-generator-definitions",
107 host_supported: true,
108 export_include_dirs: ["."],
Jiyong Park71f661c2020-04-28 18:20:43 +0900109
110 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100111 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900112 "com.android.art.debug",
Jiyong Park71f661c2020-04-28 18:20:43 +0900113 ],
Nicolas Geoffrayec388c02021-03-03 22:09:06 +0000114 min_sdk_version: "S",
David Srbecky0adf4d82018-10-01 18:17:45 +0100115}
116
117python_binary_host {
118 name: "cpp-define-generator-test",
119 main: "make_header_test.py",
120 srcs: [
121 "make_header.py",
122 "make_header_test.py",
123 ],
124 test_suites: ["general-tests"],
Igor Murashkin2bb70d32017-02-06 10:34:14 -0800125}